Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-09-01 12:55:14

marios2
Member
From: Germany
Registered: 2019-07-31
Posts: 35

Hidden Section for PP and Terms of Service in Footer

I am Working on a small Site for a local landmark in the Woods for my Brother in Law. The Site is finished so far, but I want to have a hidden Section, which does not appear in the Main Menu, so I can publish two articles for PP and TofS in the footer.

What’s the best way to go about this?

Thanks, Marios

Offline

#2 2020-09-01 13:07:30

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,269
Website

Re: Hidden Section for PP and Terms of Service in Footer

Hi Marios,
A headless section might be your best bet for this one. Alternatively you can just use <txp:section_list exclude="your_section" /> for the navigation.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#3 2020-09-01 22:05:17

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,934
Website

Re: Hidden Section for PP and Terms of Service in Footer

colak wrote #325710:

A headless section might be your best bet for this one.

That would be a good option, but be aware, it’s called a “pageless” section. There’s a recent Textpattern blog article on this topic.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2020-09-24 15:29:29

marios2
Member
From: Germany
Registered: 2019-07-31
Posts: 35

Re: Hidden Section for PP and Terms of Service in Footer

Thank you guys.

Issue resolved.

rgrds, Marios.

Offline

#5 2020-09-24 16:02:35

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,460
Website

Re: Hidden Section for PP and Terms of Service in Footer

This scenario is a good idea. It has me thinking of another one.

My current About article for the glossary project is composed of several necessarily long-ish h2 sections. I think I’d rather write these sections as smaller composite articles to collate together, but I don’t want bots and boobs scraping up URLs for them. Seems like a pageless section would be good, then assemble the pieces in the About section.

/Later that evening/

Have tested this a bit and it does work as prescribed. One unforeseen setback was that I use soo_toc for adding useful Contents lists at tops of long, sectioned articles like this so people can jump to the bit they’re inquiring about. I can add the needed IDs easily enough (<h2 id="id<txp:article_id />">) but unfortunately the plugin tag still doesn’t pick up the collated ghost articles as article sections. I can manually create the contents list, I guess. Always like herding cats, though.

Last edited by Destry (2020-09-24 16:49:46)

Offline

#6 Yesterday 14:44:38

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,460
Website

Re: Hidden Section for PP and Terms of Service in Footer

Still piggy-backing this thread, if nobody minds, as it’s closely relevant and seems better than starting a new thread for which I don’t really have a question. (I know, rare.)

It occurred to me that an article list could serve as the TOC I mentioned previously, and, in fact, is works nicely, so I thought I’d throw it on the table for anyone still needing/wanting a pageless section example to think about.

As mentioned, I’ll have a main About article with many largish subsections. About content is something I spend way too much time/effort fussing over, editing it endlessly over time. So one long-ass article (as this project seemingly requires) is kind of pain in that situation. A pageless section can help, as I see it, by breaking up those sections into discrete articles without them being found as separate published articles. Editing/revising is easier when facing just 2 or 3 paras at a time. But, again, I don’t want to sacrifice the auto-generated contents list for the collated About webpage.

So I have two sections:

  • about
  • aboutish

About gets assigned a page and a single article that serves as the head article to which the other about content pieces will be appended. Aboutish is assigned no page (the blank option) and is where all other sub-articles are assigned.

At the very top of the sole about section article I have:

<txp::contents_aboutish />

<txp:article_custom section="aboutish" form="aboutish_articles" />

The first one, a short-tag, outputs the makeshift contents list (i.e. a ToC). Here is its associated contents_aboutish ‘shortform’:

<section class="">
  <header>
    <h1>Contents</h1>
  </header>
  <txp:article_custom section="aboutish" form="aboutish_contents" wraptag="ul" break="li" />
</section>

And here’s the aboutish_contents form in turn:

<a href="#id<txp:article_id />"><txp:title escape="tidy,textile" /></a>

The article_custom tag outputs the discrete About topic articles from the Aboutish section, effectively appending them all together as a single-looking article. The aboutish_articles form:

<h2 id="id<txp:article_id />"><txp:title escape="tidy, textile" /></h2>
<txp:body escape="trim, tidy" />

The contents list is generated from the titles of the discreet articles in the order appended. The article IDs are used to create the in-page anchor links.

Of course, rename all these forms to whatever you want, if you want.

This isn’t a perfect replacement to the soo_toc plugin, because you can’t control the number of levels in the contents list, I don’t think (due to needing the IDs), but in this case I don’t need anything deeper than the first level titles, and in any case the plugin doesn’t work with pageless sections. So a working compromise.

Last edited by Destry (Yesterday 14:53:27)

Offline

#7 Yesterday 14:52:08

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,460
Website

Re: Hidden Section for PP and Terms of Service in Footer

One thing I’m worried about — another common editing situation — is needing to rearrange the order of the discrete pieces (equivalent to moving article sections around), and how, if at all, I can do that since that could be in any possible order.

Offline

#8 Yesterday 15:46:08

etc
Developer
Registered: 2010-11-11
Posts: 3,863
Website

Re: Hidden Section for PP and Terms of Service in Footer

Extracting a TOC from <txp:body /> (or whatever HTML block) is fairly easy, putting this in an article form:

<txp:etc_query data='<txp:body />' query="//h2|//h3|//h4|//h5">
    <{#}><a href="#{@id?}">{?}</a></{#}>
</txp:etc_query>

Offline

#9 Yesterday 16:42:36

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,460
Website

Re: Hidden Section for PP and Terms of Service in Footer

I need to grab etc_query, but your site is not loading, and it’s not here. :{

Offline

#10 Yesterday 16:47:53

etc
Developer
Registered: 2010-11-11
Posts: 3,863
Website

Re: Hidden Section for PP and Terms of Service in Footer

Here it is.

Offline

Board footer

Powered by FluxBB