Help with layouts for article pages.
|
7 posts
|
Hi there, On all my news articles I need to put a div around the content so that I can but a border round the content. However I don’t know of a way I can this in the layouts so that it doesn’t apply the same border to the articles page (the parent of the articles). At the moment I have to set the layout to “article page” each time I create a new article. Is there a way I can set an if statement in the layouts so it only applies it to article pages? |
|
184 posts
|
Hey, What you want to do, is check for the slug value of the articles index (parent of the articles) in the layout. If it is true, don’t show your border, else, it is a article page so show your border. Perhaps something like this before the article:
And don’t forgot to close the div after the article: |
|
1493 posts
|
I was thinking something a bit different from BlueFrog, since if you put that in your layout, it will show up on other pages than Articles, like your About page, and so on. Slight variation would be:
If you put that in your layout, it should give you your |
|
184 posts
|
Ah, David makes a good point. |
|
7 posts
|
Hi guys, Thanks for this advice. I’m loving the community here. I hope I can contribute and share my knowledge once I start getting more comfortable. |