1

I've got a product section on a website where individual product entries are categorised. On the section landing page all the products are listed organised by category. On the individual category pages only the product entries relevant to that category are shown.

The issue I’m having is that for the category landing page I want to pull in the Section landing page content. However when I try the following:

{% set entry = craft.entries.section(‘productsAndMarketsLandingPage’).first() %}

{entry} returns empty. Any thoughts why this isn’t being pulled into this particular page/template? I can access it just fine from within the

The section, template and URL structure is as follows:

Section landing page
url: /products-and-markets
template: /products-and-markets/index
section: productsAndMarketsLandingPage

Category landing page
url: /products-and-markets/{slug}
template: /products-and-markets/_category
section: productsAndMarkets

Product entry page
url: /products-and-markets/{slug}
template: /products-and-markets/_entry
section: productsAndMarkets

Cheers in advance,

Cole

2 Answers 2

1

Okay, solved.

Was an idiot and wasn't using the right tag to output the results of the query.

Sorry and thanks!

2
  • Glad you got it sorted out, Cole! Can you choose this as the answer so the question will be closed? Commented Sep 24, 2015 at 13:10
  • Can you post the tag you used to get things working for folks finding this post in the future? Commented Sep 24, 2015 at 16:50
0

How about

{% set entry = craft.entries.sectionId(productsAndMarketsLandingPage.id).first() %}

1
  • Sadly still returning empty. We are using locales on the site (with English defaulting to root) - not sure if that is what is causing the problems Commented Sep 24, 2015 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.