You can add a snippet to the page that will redirect under certain circumstances but in this case I think you are going about this the wrong way. You can’t have a public page with only an anchor link requiring login. What should happen if the user goes to the article page and simply scrolls down to the add comments section?
If you want to require login in order to add comments then use jot’s "&canpost" option.
Actually I’ve added Jot with &canpost,
the only problem in this case is this comment anchor link showup in bloglist page with blogs.
When the person without account clicked the link it shud have redirect to login page.
But it enters the link n shows the blog in detail and without comment option for non-registered grp.
What shud I do???
A few options:
- Have a general ’Comment’ link instead of an ’Add comment’ link
- Create a snippet that shows/hides the link according to the circumstances, put that in the ditto chunk.
- Create a snippet that shows different links, one link directly to add comments or another that goes through the login page first according to the circumstances.
-
☆ A M B ☆
- 24,524 Posts
There is an option in the configuration (Tools -> Configuration) of specifying documents to use for a start (home) page, a "not found" page, and for an "unauthorized" page. The "unauthorized" page could easily contain a login form.
Oh I c... thats kl...
Will reply u asap it works...
Nice... its working gud.....
-
☆ A M B ☆
- 326 Posts
I think I did something similar for a recent project using PHx::
<a href="[+phx:mo=`registered`:then=`[~[+id+]~]`:else=`[~3~]`+]">[+pagetitle+]</a>
Basically, "registered" is the web user group for someone who’s registered and logged into the site. The else=`[~3~]` part redirects to a registration/login page with an ID of 3. Everything else should be fairly self-explanatory.