1

Im trying to make a page which uses plugin code of Simple Image Gallery to load the images in that are uploaded with the article. This is the code you need to use in SIG:

{gallery}myphotos{/gallery}

But if I use this code in my template override, the string gets implemented, and not the actual code behind Simple Image Gallery gets executed. I know that you can Prepare Content in modules to get it working, but is there also a possibility to use this kind of code in template overrides?

1

2 Answers 2

3

Content plugins work in all article views whether or not they are overrides. To use them in custom components (whether in overrides or not) you can use the technique explained here: https://docs.joomla.org/Triggering_content_plugins_in_your_extension

The simplest usage being:

$text = JHtml::_('content.prepare', $text);

It sounds from your question you're overriding an article view and so the content plugin should already work. If nothing above seems to help, can you confirm that the plugin works if you don't use your override? If so something else must be afoot.

0
1

For Simple Image Gallery Pro, all you need to do is call the value for the gallery parameter. Depending on how you've referenced the article in your template, you can do something like this:

<?php if(!empty($item->gallery)): ?>
<!-- Item image gallery --> 
<a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
<div class="itemImageGallery">
    <?php echo $item->gallery; ?>
</div>
<?php endif; ?>

Note: This assumes $item is the reference to your article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.