HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Comcode for logged in and not logged in

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#42971 (In Topic #9558)
Avatar

Well-settled

I may be getting over my head here but here's my question…

I would like to create a comcode block of text that will be displayed on the main index.php page when a site visitor is not logged in. Then once logged in, another comcode block will load with a different message.

My initial feeble efforts here revolved around trying to modify the 'welcome' message in Style >Language >Global >WELCOME, but I haven't been successful getting line breaks to work in the text field.

If there's a tutorial for anything like this, please let me know. Or even if what I want to do should be attempted at my level of knowledge.

Thanks

(v 3.2.10)
Back to the top
 
Posted
Rating:
#42973
Avatar

Well-settled

Update

ok I just got line breaks to work by clearing the template cache after. I may be able to get the method I'm trying to do to work but any better suggestions for the above mentioned concept still welcome.
Back to the top
 
Posted
Rating:
#42974
Avatar

I think it will have actually been the block cache you emptied :).

Ok, so an alternate solution might be:

Code

[if_in_group="1"]You are not logged in.[/if_in_group]
[if_in_group="2,3,4,5,6,7,8,9,10,11,12,13,14"]You ARE logged in.[/if_in_group]
The long list of numbers there is just in case you have lots of usergroups.

Or for ocp4:

Code

[if_in_group="1"]You are not logged in.[/if_in_group]
[if_in_group="2+"]You ARE logged in.[/if_in_group]


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#42977
Avatar

Well-settled

Chris, much, much appreciated.

Yes, I had checked both template and block cache to clear…wow do I have a lot to learn :)

Thanks again
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: