check if page is a post-page in header

7 views
Skip to first unread message

Tanja Orme

unread,
Nov 11, 2022, 2:15:45 PM11/11/22
to nikola-discuss
Hi,

I think the shortest version of my question is, how can I check in the header (base-header) if the page is a post-page (direct link to the blog-post) or an index/page/other?

More precise, I would like to put the links to translated posts in the header, instead of in the post-area. Is this possible?

Kind regards,

Tanja

Roberto Alsina

unread,
Nov 12, 2022, 3:54:25 PM11/12/22
to Nikola—Discuss
I *think* what you want is the "kind" from the context? Not near a computer so can't check

--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/483e1bb5-92a2-4a89-a64f-a2d88b1cf347n%40googlegroups.com.

Tanja Orme

unread,
Nov 16, 2022, 6:48:44 AM11/16/22
to nikola-discuss
Yeah, I'd like to know if the page presented is a 'story' or a 'post', basically. Can I do that in the base-header template?

Roberto Alsina

unread,
Nov 16, 2022, 7:58:12 AM11/16/22
to nikola-...@googlegroups.com
I meant literally, use the "kind" variable :-)

Looking at the code it's actually called pagekind and can be (among other things) "story_page", "page_page" or "post_page"


Tanja Orme

unread,
Nov 19, 2022, 9:25:36 AM11/19/22
to nikola-discuss
Oh haha, sorry, I've been ill for a while and my brain doesn't work as well as it used to.

I think that's exactly what I want, thanks!

Reply all
Reply to author
Forward
0 new messages