2 votes

Get Entries From Any Section Matching a URL segment

To check if the word jobs is in the sectionUrl you can use twig's matches to create a regular expression that looks for jobs {% set allSections = craft.sections.getAllSections() %} {% for section in ...
Pindo's user avatar
  • 203
2 votes
Accepted

Partial match in URL getSegment()

You should be able to utilize twig's built-in containment operator. Your code would look like this: {% if 'vascular' in craft.request.getSegment(3) %} ... {% endif %} Here is official ...
Greg's user avatar
  • 76
2 votes

Request Segment URL

Assuming you're using Craft's multi-site functionality(?), you'll want to use something like {{ currentSite.handle }} to check which site they're on. For multiple sites configured to use sub-...
James Smith's user avatar
  • 5,189
2 votes

Request Segment URL

The request segments will come back as an array, where each part between slashes will be an array element so mysite.com/first/second/third gives segments [first,second,third] If you're just looking ...
Greg Bowne's user avatar
1 vote

Categories Structure for Landing Pages

If you category is related to your entry there is no need to fetch the category via url segment. This method is slower and will need more resources since you'll do the work twice for no reason. entry....
Robin Schambach's user avatar
1 vote
Accepted

How to write a segment that is not two other segments

I personally try to avoid inlining too many conditionals because I feel like it leaves room for logical loopholes. I also think using variables for segments keeps things easier to read. {% set seg2 = ...
Ryan's user avatar
  • 1,952
1 vote

Get Entries From Any Section Matching a URL segment

If I understand you right all you need is: {% for section in allSections if craft.request.getFirstSegment() == 'jobs' %} {# other code here #} {% endfor %} You can give conditions to your for ...
Justin Dekkers's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible