Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-06-26 00:53:13

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Static pages

It occurs to me, if the newer txp version allows you to set the url structure per section, like /title for a section named hidden, if hidden had an option to make it return 404 like headless sections can, BUT allow any articles in it to be viewed, you could link to the article in navigation as your about, contact etc. Just thoughts for making static page publishing easier without having two urls, also would give you access to article variables to use in head like article img etc. Although the section is 404, you could still allow the articles for search or rss so long as the section link was never exposed. Maaybbbeee! Though linking then could be a pain. I know headless sections can accomplish this but it’s trying to avoid hardcoding section titles in order to manually output the article too.

:)


…………………
I <3 txp
…………………

Offline

#2 2021-06-26 08:19:34

etc
Developer
Registered: 2010-11-11
Posts: 5,130
Website GitHub

Re: Static pages

It looks like you’d like something like this? Dunno why it has not been implemented.

Offline

#3 2021-06-26 10:18:22

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

etc wrote #330709:

It looks like you’d like something like this? Dunno why it has not been implemented.

Yes that looks like it would do it! It’s the one thing that comes up for myself and others fairly frequently, how can I ‘hide’ the individual article for a static page section, then even though the static page is marked up like an article (right to do even if static), you don’t have access to the usual article tags you get on a dedicated article page. It would mean your static pages no longer have a trailing slash, that’s fine as long as you’re always linking to the non trailing version.

The only thing remaining is the ability to include a link to that article in your navigation so section list wouldn’t be able to output them, if section list did have an attribute that instructed if this ‘hidden’ section is referenced in section list, then output the article links. But without that the benefit of a single url is worth the effort of manually building out the nav for the moment!


…………………
I <3 txp
…………………

Offline

#4 2021-06-26 10:33:15

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

Just thinking more about it, if you also had the option to include a trailing slash, it’s now backwards compatible. So my existing about/ page can still go to about/, if I add the existing article to the new hidden section, edit its url metadata to match the previous section link so the article link is just ‘about’ now, I’m now live as a ‘section’ / static page without duplicate urls, my styling might look different as I’m now under an individual article location not a list, but overriding the default form with a single page form could fix that (which I already do), and the navigation won’t output the link in my top nav now either.. but it’s close to what would work :)


…………………
I <3 txp
…………………

Offline

#5 2021-06-26 10:45:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,408
Website GitHub

Re: Static pages

If there’s a neat(er) way to handle static/single page content than via pageless sections (e.g. the listable concept Oleg linked to) then I’m all for it, as long as we consider the most natural/usable use cases as defaults. Any esoteric use cases could be permitted by combining attributes and admin toggles in weird and wonderful ways we can’t possibly imagine right now.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2021-06-26 11:25:06

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

Bloke wrote #330716:

If there’s a neat(er) way to handle static/single page content than via pageless sections (e.g. the listable concept Oleg linked to) then I’m all for it, as long as we consider the most natural/usable use cases as defaults. Any esoteric use cases could be permitted by combining attributes and admin toggles in weird and wonderful ways we can’t possibly imagine right now.

Hi Stef!

I think the first principal on my wish list is that the article would need to be output as if it is on an individual article page, so that your static page still can output your og image and other attributes accessible in an individual article context. Then if you’re wanting to style it differently, it’s by overriding the default form.

Having the option to include a trailing slash or not could be handy, and maybe being able to include the ‘hidden’ section in a section link, that loads in the article url.

It seems better to me than for example, loading the section page and making the individual article 404, because with that method you still have to do jiggery pokery to try and access article attributes, and you also don’t have to manually output the article with a section=, I like not putting section names in manually just makes it a bit more manageable!

User friendly too as someone can just when creating a section, mark it as a static/single article page, indicate whether it should have a trailing slash or not, publish an article to it, and maybe the link even automatically outputs in section list. (That would obey trailing or no trailing slash in its convention)

A wish list really :)


…………………
I <3 txp
…………………

Offline

#7 2021-06-26 11:28:27

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

And because it’s still assigned to a section, although the section isn’t accessible via any url, you could potentially still output if section name tags


…………………
I <3 txp
…………………

Offline

#8 2021-06-26 11:31:40

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

Also, because we have the ability to create our own site maps, which I find fabulous, maybe it would be easier to then generate a site map where at the moment you have to make sure individual article urls aren’t exposed in there, hard coded for most people, where maybe this would let you freely output a section list, with no fear as to the output and no need to manually define static pages anymore


…………………
I <3 txp
…………………

Offline

#9 2021-06-26 12:53:48

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

What I like too is that it works because you can assign the url structure /title to the section, where for your blog you can still keep the /blog/title structure as it’s set per section now already

If people down the road wanted to change that section to show multiple articles, they would need to 301 redirect the / to no trailing slash for the original article if they had used that convention. If they hadn’t they’re good to go, the original article is still accessible at the same url, it just might not be linked in the top nav anymore but is linked on the now exposed sections article list page.


…………………
I <3 txp
…………………

Offline

#10 2021-06-26 13:12:30

hilaryaq
Plugin Author
Registered: 2006-08-20
Posts: 335
Website

Re: Static pages

I keep thinking of new stuff apologies! But if you could access the section like if section status = hidden, then you could output for example a hero section for static pages in the normal way you would but again without having to hardcore the section name. So if I have a form that outputs a section title and has a hero styling to it before the article is displayed, that you could still do that. For every section that’s hidden please output this form, and the form can print the section title or anything at that higher level.


…………………
I <3 txp
…………………

Offline

Board footer

Powered by FluxBB