0
Welcome Guest! Login
0 items Join Now

SOLVED Automatically Assigning Title Spans w/ php

  • SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 5 months ago
    • The following link outlines how to automatically format the first word of a title differently from the rest of the title using a span. However, it is apparently for a non-gantry environment as the referenced file looks nothing like the file shown in the example. So the question is, what file do I need to modify to duplicate the same effect? Would the modifications be essentially the same?

      www.gavick.com/forums/115/title-spans-15181.html

      Or is there a better way to do this?

      Thanks!
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 5 months ago
    • That is an HTML override and yes you can do essentially the same thing with the override in your template - depending on the template you would need to create a new one (or change one if it already exists) in /templates/whatevertemplatename/html/joomla/..... etc (depends on your joomla version too). If you have to create one then you'll need to copy the gantry component override.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 5 months ago
    • Hello Mark,

      Well, I did leave out a few details didn't I... :)

      I'm working with Jommla 3.3.6 and the RT Anacron template. I'm also new to joomla and gantry.

      So there's 48 php files under the rt_anacron directory. Since gantry overlays on top of the default.php file, per best practices, which is the best file to modify to accomplish what I'm trying to do?

      Thanks!
      John
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • The file that you need to modify is /templates/rt_anacron/html/modules.php

      If you modify this file then you be aware that any template updates will overwrite the file again, so you should keep a backup of your changes.

      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • That does indeed work! Regarding your note about template upgrades overwriting this file, I'm wondering if there is still a better option. The call echo $module->title clearly calls a module class that knows how to render the title. Would this be a better option? Which also raises another question, do you have a good reference for the class heirarchy that's being used?

      Thanks for all your help!
      John
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • The file you are changing is the correct way - any other method would also necessitate changing template files - so the warning about updates would always need to be heeded. No, there is no documentation on the internal class hierarchy to gantry. For joomla class hierarchy see joomla documentation on their site.

      Regards, Mark.
    • The following users have thanked you: John Kramer

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • That worked so well we'd like to do the same with article titles on a category blog page. So now my questions are: what file to modify and how do I get the needed variable reference? In this case, I suppose the variable is an array/list type that I'd need to iterate over.

      Thanks again!
      John
    • MrT's Avatar
    • MrT
    • Preeminent Rocketeer
    • Posts: 101084
    • Thanks: 13484
    • Web Designer/Developer

    Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • This is really customisation work which is beyond the scope of this support forum. But I can give you some pointers. Anacron does not have any overrides for the joomla blog layout. But gantry does, so you have to copy the gantry override to the anacron template and edit it there.
      Assuming you are using J3.3 one example...

      copy
      /plugins/system/gantry/overrides/3.3/2.5/com_content/category/blog_item.php
      to
      /templates/rt_anacron/html/joomla/3.3/2.5/com_content/category/blog_item.php

      Then edit it. Other overrides for com_content are done in the same manner - if you want look at some of our other templates where we have done this then take a look at Cerulean.

      New questions = new topics now please to be fair to other members.


      Regards, Mark.
    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information.
  • Re: SOLVED Automatically Assigning Title Spans w/ php

    Posted 10 years 4 months ago
    • The directory given above is incorrect. The correct directory to copy the file to is:

      /templates/rt_anacron/html/joomla/3.3/com_content/category/blog_item.php

      Thanks,
      John

Time to create page: 0.081 seconds