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.


[SOLVED] Customizing the Blog View

Login / Search

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

Community saint

Hey All! I'm trying to customize the entry page for the blog system but I'm not having much luck finding the file(s) I need to modify. I've tried by embedding, including and iframing, but none of those produces the desired effect. Here is the URL I'm using
index.php?page=news&type=blog_select
Picture is worth a thousand words! :)



Last edit: by SoccerDad

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#50094
Avatar

Community saint

Getting closer! ;)

This (to me) is a template/tempcode issue. I think the appropriate template is SCREEN_TITLE.tpl and I need to insert an IF tempcode statement that identifies type=blog_select and inserts the custom text/image for that. If not, the change affects all news related screens and that is too broad.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#50132
Avatar

Community saint

Narrowed it down (I think) to where I need to be, still SCREEN_TITLE.tpl:
{+START,IF,{$EQ,{$SELF_URL},URL}}
where URL is the full URL to the blog entry page. Unfortunately this is not working as I'm missing something fundamental. I have tried assigning the variable at the beginning of the template
and
{$SET,$SELF_URL,URL}
, no joy. Using {$PAGE} does not seem to work either as the type=blog_select is buggering that up. Unfortunately no codebook either so now I'm kinda stuck.

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#50136
Avatar

Answer coming...


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:
#50137
Avatar

The INDEX_SCREEN_FANCIER_SCREEN is the best template to edit.

There's a GUID you can use in this case which is best. The GUID is a unique code assigned to this particular use of this shared template.

Code

   {+START,IF,{$EQ,{_GUID},c61c945e0453c2145a819ca60e8faf09}}
      ...
   {+END}

With regard to your last post, purely for the purposes of spreading some information (the GUID solution is best)…

Code

   {$SET,URL,http://xxxx.xxxx.com/s...ews&type=blog_select}
   {+START,IF,{$EQ,{$SELF_URL},{$GET,URL}}}
      ...
   {+END}
would have probably done it.

To use $PAGE (which is better as URLs can change for various reasons)…

Code

   {+START,IF,{$AND,{$EQ,{$PAGE},news},{$EQ,{$_GET,type},blog_select}}}
      ...
   {+END}

Or even better $MATCH_KEY_MATCH…

Code

   {+START,IF,{$MATCH_KEY_MATCH,_WILD:news:blog_select}}
      ...
   {+END}


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:
#50139
Avatar

Community saint

Thanks very kindly Chris! Just the info I was looking for. I had started down the path you mentioned "To use $PAGE (which is better as URLs can change for various reasons)", borrowing from HEADER and GLOBAL code as examples, as well as looking at MATCH_KEY but the trial and error method is a pain at best. ;)

Oh well, on the upside: at least I know now (for future endeavours) that I was more or less heading down the correct path and the logic my wee brain used to get to the starting point was fairly sound. Builds a little more confidence that I will need to tackle the sample addon you provided.

For other readers: this code example is fantastic. I was looking for a specific function, however, if you look over what Chris has provided and fire the imagination, you can quickly see how far you can take the code/logic to build some (more) kewl things on your OCP driven site.

One final query if I may Chris: is it possible to include comcode pages in template files? It would be cleaner to just include another page as opposed to putting all my HTML code right into the template. I can't find any reference to this in the tempcode tutorial.

Cheers!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
Posted
Rating:
#50144
Avatar

Look at 'LOAD_PAGE' in the Tempcode tutorial (should explain how to use it).

{$LOAD_PAGE,some_page,some_zone}


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:
#50146
Avatar

Community saint

Great, that's the ticket. Thanks again Chris; learned a truckload yesterday and today with regards to tempcode in this project I'm working on. Very kewl!

"no violence, no hate, no pain, no enemies
just peace, unity, tolerance and love" - The Beloved

OCP V7 | Advocating monetary reform - FreeOurMoney

Need OCP friendly hosting? Look no further:
Web Hosting, Reseller Hosting, and Dedicated Servers w/cPanel - Elief! - Official hosting partner for ocPortal.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: