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.


[Resolved] Comcode child pages

Login / Search

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

Community saint

Hello! Just looking for confirmation on this issue before I add it as a bug: I have some pages that are just crying out for the comcode child page feature, but there seems to be an issue with the displayed title. I tend to use archane code names for my comcode pages as this allows me to keep them nice and organized. Unfortunately, OCP seems to use those names instead of the contents of the title tag when displaying the link on the parent page. The work around is to go back and edit the child page by simply saving it and now the title tag contents are displayed as the child link on the parent page. This would be OK 'cept that everytime the caches are cleared it reverts back to the actual comcode page name and not the contents of the title tag. As I'm sure you can imagine, this is a bit of niggler. ;-)

To recreate:

  1. Create a comcode page to use as your parent.
  2. Create another comcode page, give it a funky name, add a title tag and set the parent as the page created in the previous step. Save.
  3. View your parent page to see what title is displayed. In my case it would be the funky one.
  4. Edit the child page, make no changes, just save.
  5. View the parent page again and the contents of the title tag should now be displayed.
  6. Clear caches.
  7. Parent page again and you should be back to #3.
TIA!
TR


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

I think this will ameliorate it. It decaches the main_comcode_page_children block when a Comcode page is cached. So now you don't need to edit a page to fix it, just visit it.

Attachment
sources/site2.php
» Download: site2.php (15 Kb, 87 downloads so far)


And this may fix it entirely, it makes the block ask the child page to load up if it is not already cached to force title-detection.
Attachment
sources/blocks/main_comcode_page_children.php
» Download: main_comcode_page_children.php (3 Kb, 85 downloads so far)


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

Community saint

As always Chris: awesome! That appears to have solved the issue (I replaced both files).

Thanks!

"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: