0
Welcome Guest! Login
0 items Join Now

Template override for use of custom fields

    • RustyR's Avatar
    • RustyR
    • Hero Rocketeer
    • Posts: 436
    • Thanks: 1

    Template override for use of custom fields

    Posted 6 months 1 week ago
    • Hi there!

      I made a template override of com_content > article, with the intention that some of the custom fields can be placed left of the article content. I used the following code in the override:
      <div class="g-grid">
                  <div class="g-block size-40">
                    <?php if (isset($this->item->jcfields[5])): ?>
                  <?php echo $this->item->jcfields[5]->value; ?>
              <?php endif; ?>
                  </div>
                  <div class="g-block size-60">
                    <?php echo $this->item->text; ?>
                  </div>
              </div>

      As you can see I used the custom responsive grid of Nucleus. Is this the proper way to do it or can I also make use of Bootstrap (4 or 5)? I tried this by adding bootstrap 4 and 5 via Custom CSS / JS atom, but it didn't work with the bootstrap classes.

      Thanks,
      Remco
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21595
    • Thanks: 3098
    • messin' with stuff

    Re: Template override for use of custom fields

    Posted 6 months 1 week ago
    • Nucleus' Grid Code is documented here: docs.gantry.org/gantry5/advanced/responsive-content

      Your screen shots look good for how you're loading the hosted JS.

      I wouldn't use any Bootstrap that I wasn't loading myself... Joomla/Gantry load there own specific libraries that you can't rely on to use for the whole suite of Bootstrap things... the version loaded from the Javascript Frameworks Atom should be the complete base libraries, with some very minor adjustments to play nice with Gantry.
    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • RustyR's Avatar
    • RustyR
    • Hero Rocketeer
    • Posts: 436
    • Thanks: 1

    Re: Template override for use of custom fields

    Posted 6 months 1 week ago
    • Thanks Matt,

      Do you have any idea why the following code doesn't work using the Helium template with Bootstrap 4 (and later also 5) loaded via the atom?
      <div class="row-fluid">
          <div class="col-4"></div>
          <div class="col-8">
              <?php echo $this->item->text; ?>
          </div>
      </div>

      Cheers,
      Remco
    • Matt's Avatar
    • Matt
    • Preeminent Rocketeer
    • Posts: 21595
    • Thanks: 3098
    • messin' with stuff

    Re: Template override for use of custom fields

    Posted 6 months 1 week ago
    • This would be unrelated to RocketTheme templates or Gantry and is outside the scope of moderator support. This is the still an appropriate forum for the question if others want to reply.
    • The following users have thanked you: RustyR

    • SEARCH the forum first! These boards are rich in knowledge and vast in topics. This includes searching just the 'Solved' forums, using Google, and using ChatGPT :woohoo:
    • RustyR's Avatar
    • RustyR
    • Hero Rocketeer
    • Posts: 436
    • Thanks: 1

    Re: Template override for use of custom fields

    Posted 6 months 1 week ago
    • Hi Matt,

      I understand! Thanks for replying.

      Best,
      Remco

Time to create page: 0.036 seconds