Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Robert Member
@metbril · Joined 8 years ago · 49 posts · 11 topics · 3 reputation
Badges
Recent posts
-
How to add default content on new page
· 8 years ago
I can’t remember where, but there was an example somewhere that lets users use forms to add content without using the admin interface. Perhaps that is a viable alternative.
-
Customize plugin template outside theme
· 8 years ago
I want to customize a twig partial template that is provided by a plugin. And be able to use this regardless of the theme I am using. So the custom twig cannot reside in /user/themes/mytheme/templates
-
Replace long if/elseif/else with array search
· 8 years ago
Yeah, that would be the easiest. I read an example from the iplocate plugin and that was overly complex for this purpose (a mainly static list of icons).
-
Replace long if/elseif/else with array search
· 8 years ago
@pamtbaau: And if you don’t want to edit your code all the time, you could save the icons definition into /user/config/icons.yaml : The twig is a partial of my template. Is there a simple way to have
-
Replace long if/elseif/else with array search
· 8 years ago
I blindly used array_search(s_url, icons) instead of array_search(domain, icons). This returned an empty string for icon, so I assumed the function was unsupported.
-
Replace long if/elseif/else with array search
· 8 years ago
My bad. It is working now.... The s_url isn't a domain name, but a canonical url to a page. I first had to retrieve the domain name from the url. This is my current working code: item.md --- title: 'L
-
Replace long if/elseif/else with array search
· 8 years ago
It looks like the PHP array_search() function is unavailable in Twig.
-
Replace long if/elseif/else with array search
· 8 years ago
Perhaps a nice challenge for @pamtbaau?
-
Replace long if/elseif/else with array search
· 8 years ago
I currently have a very long if/elseif/else that can only keep growing: {% set default_icon = "globe" %} {% for s_url in page.header.syndication %} {% if "twitter.com" in s
-
onAdminSave() for setting route default override
· 8 years ago
I think I figured it out... I can now just place all blog items under the main blog page and create one big collection. And still use the nested structure. 😃 This is what I did. I will do some additio