Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2018-04-04 08:47:11

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,653
Website

Re: smd_at_work: click to put your site in maintenance mode

Bloke wrote #310604:

The confusion is all mine.

Confusion, confusion everywhere…

Thanks, now I have a textarea.

Offline

#32 2018-04-04 15:23:42

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,193
Website

Re: smd_at_work: click to put your site in maintenance mode

Anyone (not necessarily Stef)…

I have forms that build the opening and closing parts of my templates. The closing part includes the footer. These “global” template forms are used on the default page, thus used on the 503_error page too (as per default behavior).

But here’s the thing. There are a couple of links in the footer that I don’t want to appear when the site is in m-mode because they point to internal locations, which won’t work in that case and showing them is just bad UX, I think.

I could easily deal with this if there was a contextual class selector (e.g. <body class="error"> that functioned in relation to the plugin, but I’m not coming up with anything for how to do that otherwise. If I add my own class, it just impacts the content whether plugin is on or off.

You see what I mean?

Any genius txp tag magic to be had here?


The text persuades, the *notes prove。

Offline

#33 2018-04-04 15:29:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: smd_at_work: click to put your site in maintenance mode

Destry wrote #310612:

Any genius txp tag magic to be had here?

Does the built-in plugin <txp:smd_if_at_work> conditional tag help?


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

#34 2018-04-04 17:10:07

Destry
Moderator
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,193
Website

Re: smd_at_work: click to put your site in maintenance mode

Yeah… I’ve been staring at those tags for a day, but now that you call it out, I see what you mean. It’s okay as a wrapper, then, I guess?

I’ll try it.

<txp:smd_if_at_work>
show only 3 of 5 lines
<txp:else />
show all 5 lines
</txp:smd_if_at_work>

The text persuades, the *notes prove。

Offline

#35 2018-04-04 17:23:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,629
Website

Re: smd_at_work: click to put your site in maintenance mode

Destry wrote #310615:

It’s okay as a wrapper, then, I guess?

It only works as a wrapper. A good one. Not Kanye.

An alternative to your example:

<txp:smd_if_at_work>
    show 3 lines specific to maintenance mode
</txp:smd_if_at_work>
show remaining two lines common to both modes

Last edited by Bloke (2018-04-04 17:24:06)


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

Board footer

Powered by FluxBB