Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-03-11 06:02:21

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

hide html comments

not sure if this has ever been discussed: Hiding comments in html source code.

If one wants to add a comment to a HTML code page such as <!--Navbar Brand--> that code is not parsed by a broswer but remains visible in page source. in another cms i have seen the use of {!-- Nava Brand --} which is not visible via page source. Is this something that can easily be applied to Textpattern?


…. texted postive

Offline

#2 2017-03-11 06:49:08

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: hide html comments

Hi bici

<txp:hide>comment here</txp:hide>

alternatively you could use ruud’s plugin so as to make comments visible in the source code but only if you are logged in the admin side of the site.

Something like:

<txp:rvm_if_privileged>Comment here</txp:rvm_if_privileged>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2017-03-11 11:37:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: hide html comments

I also have soo_hide, which hides or shows based on the site’s production status.


Code is topiary

Offline

#4 2017-03-11 16:07:11

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: hide html comments

jsoo wrote #304579:

I also have soo_hide, which hides or shows based on the site’s production status.

hmmm… how did that one escape me? I like its simplicity,


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2017-03-11 17:53:29

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: hide html comments

thanks! I was not aware of the <txp:hide> tag. nor of soo_hide …. which i have settled on.

PS Jsoo – Welcome back to TxP from your desert wanderings


…. texted postive

Offline

#6 2017-03-11 18:49:29

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,091
Website Mastodon

Re: hide html comments

oopps just noticed this error:

Tag error: <txp:soo_hide force="1"> -> Textpattern Notice: unregistered_tag while parsing form None on page default


…. texted postive

Offline

#7 2017-03-11 20:03:48

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: hide html comments

Oops, sorry. Just uploaded a Txp 4.6 compatibility update.


Code is topiary

Offline

Board footer

Powered by FluxBB