0
Welcome Guest! Login
0 items Join Now

What file adds tag divs into article so I can adjust it

    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    What file adds tag divs into article so I can adjust it

    Posted 6 years 2 months ago
    • I upgraded to Gantry 4.1.10 and I'm glad to see that the new J3.1 tags have been integrated in.

      I have built a custom template with a custom name, and am slowly migrating the new code over. However, although I have not made any modifications to my custom template, I do see that the tags are being injected into the articles, so I assume that function is added via the framework and not the template directly.

      Where can I find the code that adds the tag divs? And how do I control their positioning? Right now, they are being displayed at the bottom-left corner within the <article class="item-page> element.

      My articles have the following basic structure:
      <article class="item-page>
           <div class="gantry-width-block">
                <!-- START: Modules Anywhere -->     
                     A series of divs     
                <!-- END: Modules Anywhere -->
           </div>
           <div class="clear"></div>
           <div class="details">
                Core of article content
                <h3></h3>
           </div>
      </article>

      What I'd like to do is to have the tags display to the right of the <h3></h3> element in the article core.
    • Thank you.

      Ali Samii
  • Re: What file adds tag divs into article so I can adjust it

    Posted 6 years 2 months ago
    • Ali Samii's Avatar
    • Ali Samii
    • Elite Rocketeer
    • Posts: 629
    • Thanks: 2

    Re: What file adds tag divs into article so I can adjust it

    Posted 6 years 2 months ago
    • Hi Reggie,

      Yes, I have. As you are probably aware, tags are a new feature of Joomla 3.1.x. The only reference to the new tags capability I have found anywhere on the Gantry Framework site (including the documentation) is the line in the release notes for Gantry 4.1.10:

      New Feature
      • Added Joomla 3.1 Tag support to Article and Contact overrides


      As I mentioned, I have a customised version of the default gantry template, and I have not merged the new code in to the older template structure...but I have updated the framework to 4.1.10 and I see that the new tags provided in Joomla 3.1.x are being injected into the article view. Nonetheless, I still cannot find the file in which the div structure is being derived from.

      I have looked throughout the file structure of /libraries/gantry and I can't find it...and I am assuming that the default.php or items.php file for the com_article views is somewhere resident in that hierarchy, as the framework overrides the Joomla core.
    • Thank you.

      Ali Samii
  • Re: What file adds tag divs into article so I can adjust it

    Posted 6 years 2 months ago
    • Hello Ali,

      Basically, Gantry has a standard set of HTML overrides that are contained within the /plugins/system/gantry/overrides/ directory. You can see a whole host of overrides in here for the various core components and modules. This is where the tags code is coming from, specifically: /plugins/system/gantry/overrides/3.0/2.5/com_content/article/default.php

      You don't want to edit these files however, as you need to edit the HTML overrides in the template directory instead, but use the Gantry overrides as a reference point, e.g. copy them over as and when you need them.

      I will use com_content > article > default.php as my example to explain how the overrides work. Joomla, by default, will load /components/com_content/views/article/tmpl/default.php for an Article item. If Joomla detects that the active template has an override in place, as in /templates/TEMPLATE_NAME/html/com_content/article/default.php then it will load that instead.

      Nevertheless, within that file, we have:
      include JPATH_SITE.'/templates/'.$gantry->getCurrentTemplate().'/html/base_override.php';

      This loads the /html/base_override.php file which performs the following, for any files that reference it. It basically redirects Joomla from looking in the /html/com_content/article/default.php file to /html/joomla/VERSION_NUMBER/com_content/article/default.php instead, so we can have different overrides based which Joomla version is in use such as 2.5 and 3.0. If none are present, it defaults to the Gantry overrides in the /plugins directory. If there are no overrides reference in /html/, then Joomla will load the core files, even with Gantry installed.

      Therefore, if you wanted to override this, then you'll just want to copy the files from the /plugins/etc.../overrides directory into /html/ as normal. You can either replace /com_content/article/default.php with the Gantry file, and edit accordingly, or add it to the /html/joomla etc... directory for your specific Joomla version. The former is probably the easiest for your purposes.

      Hope that offers a decent explanation. Its complicated to explain but simple in practice.

      Cheers,

      James
    • James Spencer / Developer & Support / Hull, UK

Time to create page: 0.064 seconds