1

I have setup fancybox2 in my joomla3 site. It is working, but I need to display only the component area inside the window when a link is clicked. Is there a way of doing this?

My fancybox js currently is:

<script type="text/javascript">
    $(document).ready(function() {
        $(".fancybox").fancybox({
        type: 'iframe',
        openEffect: 'elastic',
        closeEffect: 'elastic'
        });
    });
</script>
1

As @subashbasnet8 pointed out, you can add tmpl=component to your URL. This will display your site using the file JOOMLAROOT/templates/YOURTEMPLATE/component.php, a template file that loads the HTML headers and your component area (as opposed to the index.php file that usually is loaded).

You can modify this file if needed, or you can create your own custom view by adding another .php file to your template directory, e.g. JOOMLAROOT/templates/YOURTEMPLATE/customview.php. This customized file can be used by adding tmpl=customview to your url.

Regarding SEF urls, take a look at this answer.

3

If you want to load only component in view add tmpl=component in url of that page you want to open. for example:

     joomlasite.com/index.php?option=com_component&view=page
     (this will load whole joomla site)

but

    joomlasite.com/index.php?option=com_component&view=page&tmpl=component 
    (this will load only component part in view).

hope this will help.

  • Thanks for replying. I'm a bit confused: is this supposed to work with sef urls? e.g /sefurl&tmpl=component – DDA Jan 29 '15 at 11:44
  • try using JRoute class while creating url for more <?php echo JRoute::_('index.php?option=com_component&view=page&tmpl=component'); ?> – subashbasnet8 Jan 29 '15 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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