Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-12-09 19:58:57

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Password Protect individual blog entries

How can I password protect certain blog entries? Or at least be only accessible by a non-public link? is that what the “hidden” option is for?

Offline

#2 2015-12-09 20:39:54

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Password Protect individual blog entries

Put this at the start:

<txp:password_protect login="woo" pass="pop" />

Where woo is your login name and pop is your password. I’ve never used this, so I don’t know if it works with just pass="". In fact, I’ll try it out now. Hold tight.

Offline

#3 2015-12-09 20:41:09

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

This would do individual entries? okay, I’ll try it, too and see.

Offline

#4 2015-12-09 20:42:37

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Password Protect individual blog entries

gaekwad wrote #297022:

I don’t know if it works with just pass="".

It doesn’t — you’ll need both login and pass.

Last edited by gaekwad (2015-12-09 20:42:47)

Offline

#5 2015-12-09 20:45:11

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

It seemed to work. And just for that entry. I went to the entry I password protected and it wanted a login and password. then I clear my cache and linked to another unprotected entry and it went right to it. I tried to then link to the password protected one and it asked for my password.

I think that’s what I needed. coolio. thanks bunches…

Offline

#6 2015-12-09 20:46:47

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Password Protect individual blog entries

Onlyduh wrote #297023:

This would do individual entries? okay, I’ll try it, too and see.

Yes, individual entries. You could put that in a page template to cover an entire section, but be aware that if someone switches the section in the URL and that calls another page then it’s effectively useless. See the note here for info.

Offline

#7 2015-12-09 20:47:42

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

Oh okay. dang.

Offline

#8 2015-12-09 20:50:11

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

Okay. it seems to protect the entry no matter which way I come at it. From archives or from the listing. So, its generally doing what I need it to do. I can’t do an iron clad lock on it, but nothing is really that secure anyway. It just makes it a little harder.

Offline

#9 2015-12-09 20:52:07

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Password Protect individual blog entries

If it’s a per-article basis, you’re good – there’s just a bit more base-covering if you want an entire password-protected section instead. It’s doable, just needs a few more tag bits. This should work (untested) for individual articles, even if folks monkey around with your URL format:

<txp:if_article_section="secret_stash"><txp:password_protect login="pop" pass="plip" /><txp:if_article_section>

Offline

#10 2015-12-09 20:55:38

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

That is fabulous. I had run across the tag but wasn’t sure how it was going to work. I needed some other smarter person like you to demo for me.

Offline

#11 2015-12-09 20:56:57

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: Password Protect individual blog entries

No worries! By all means use the demo site in my sig if you want to poke around some more without breaking a live/dev site.

Offline

#12 2015-12-09 20:57:32

Onlyduh
Member
Registered: 2015-02-07
Posts: 37

Re: Password Protect individual blog entries

You dah man….

Offline

Board footer

Powered by FluxBB