Joomla's jdoc:include style - joomla

i am new in Joomla.
i found this code in my Template:
<jdoc:include type="modules" name="search" style="xhtml">
but i do not understand , whats this style="xhtml" refer ?
in my other joomla template , i see below code:
<jdoc:include type="modules" name="footer" style="e4jstyle">
so, whats this style means ? i change this style name, but didn't see any change.
Please, can anyone explain this code?

This is known as module chrome and it's an easy way to wrap extra html around the module output so you can style the front-end result. There are a number of different options, here's one reference to get you started: http://docs.joomla.org/Standard_Module_Chromes
It's not on the list above, but one I like to use for Joomla 3 is style="html5"
EDIT
This will get you started if you want to roll your own module styles: http://docs.joomla.org/Applying_custom_module_chrome
Good luck!

Related

Make entire div clickable

I am trying to get the whole div clickable and this works but only with a straight link to another site. Is there a way to make it work with this text in it also:
<div class='reddit' title='Share Us On Reddit' onclick="window.open('http://www.reddit.com/submit?url=httpsFwww.example.com&title=XXX is Cape Breton's Homepage. Start Your Web Search With Beautiful Cape Breton Island')">
Thanks
From CSS Tricks
This probably isn't a thing you need to rely on JavaScript for
anymore. Since HTML5, this is perfectly valid:
<a href="http://example.com">
<div>
anything
</div>
</a>
And remember you can make links display: block; so sometimes you
don't even need the div.
<div style="cursor:pointer" onclick="document.location='evenidontknow-page.html'">
<h2>Full Div Clickable</h2>
</div
The above code helped me very well, and this will not require any extra code.
Using a tag may solve the problem but we need to add extra code to it.
please check this link for more info w3schools
Bootstrap has a feature called "Stretched Link". From the documentation:
Make any HTML element or Bootstrap component clickable by “stretching” a nested link via CSS.
You can read more by visiting the following link:
https://getbootstrap.com/docs/4.4/utilities/stretched-link/

EmberJs ember-animated-outlet not working

I'm trying to use ember animated outlet (found here) and, I can not for the life of me get it to work, I understand that instead of using {{outlet}} I need to use {{animated-outlet}} and use {{link-to-aniamted}} instead but it seems to be switching like normal. I also know that I need to include the js after the ember.js and also I am including the css file it comes with, so I'm kind of stumped on this. :(
For my basic view, I'm using
<script type="text/x-handlebars" data-template-name="application">
<div class='wrapper'>
#include('includes.globals.header')
<div class='content row' id='content'>
{{animated-outlet}}
</div>
#include('includes.globals.footer')
#include('includes.js.navigation')
</div>
</script>
and my link looks like:
{{#link-to-animated 'index' animations="main:slideLeft"}} Home #{{/link-to-animated}}
So, is there something i'm missing? Do I need to add something in my app.js? IF you need more code or info, just ask and I will edit this question! Thanks a lot in advance! I'm new to ember, so please take it easy!
You need to specify 'name' in the animated-outlet helper.
{{animated-outlet name="main"}}
The readme explains it: https://github.com/billysbilling/ember-animated-outlet/blob/master/README.md#use-animated-outlet-instead-of-outlet

Can I put a Joomla extension as the only item at frontend?

What I need to do is to put a Joomla extension, JDownloads, as the only item at the frontend. I mean, no menus, no header, no footer, no other things at frontend, only JDownloads.
I'm a newbie in Joomla, so I have to ask. Is this possible, at first place? If it is, how can achieve it?
Thanks!
No need to do anything other than make a single menu item to your JDownloads component. If you don't add any modules then all that will display is the component.
You could fork one of your templates (atomic is the simplest one) eg from
/templates/atomic
to
/templates/simply
tweak a few parameters in /templates/simply/templateDetails.xml
<name>atomic</name>
and in /templates/simply/index.php replace the contents of BODY tag with:
<jdoc:include type="message" />
<jdoc:include type="component" />
Then set it as your default template or use as helper for other site

Joomla 1.5: $this->countModules returns 1 for Jumi module even when empty

Working on a site in Joomla 1.5! Typically when testing if a module position is empty in Joomla! I'd do something like this:
<?php if ($this->countModules('position')): ?>
BEFORE
<jdoc:include type="modules" name="position" style="xhtml" />
AFTER
<?php endif; ?>
But in my case I have a jumi module that references external source of code.
In some situations it will be blank, which in that case, I don't want the BEFORE and AFTER bits showing either. But whenever I try running the above code, the before and after sections show up, because
$this->countModules() returns 1 instead of 0.
I have "Hide if empty" set to "Yes" for the module, but that doesn't seem to help.
I've even tried setting a return false; on the external source code but that doesn't seem to help either.
Does anybody have any suggestions?
Hide if empty cannot hide the BEFORE and AFTER because it's in the count condition.And BEFORE and AFTER will only hide if no module is enabled for that position. So to hide these you'll have to put this content inside your module.And check the if empty condition.
Let me know if it's not clear.

How to style Joomla 2.5 article's intro text?

It's very strange but I haven't found a really good solution by googling joomla style intro text.
I want that the current output:
<div class="item-content">
<p>Intro Text</p>
<p>Full Text</p>
</div>
to be replaced by:
<div class="item-content">
<div class="introtext"><p>Intro Text</p></div>
<div class="fulltext"><p>Full Text</p></div>
</div>
I was sure that Joomla itself should have declared such a class for introtext or at least should have a configurable option for that.
What I do NOT want:
A Joomla 1.x or Joomla 1.5 solution
A manual way until there is not
an extension-base solution (which is more more strange!)
UPDATE after {THIS} answer
Now I have a problem with $this->item->introtext, $this->item->fulltext and $this->item->text.
I expect $this->item->introtext to show ONLY introtext, but it also contains the contents AFTER READ MORE.
What property should I use to only include contents BEFORE READ MORE, not anything else?
I don't expect that the $this->item->introtext content be affected by Show Intro Text parameter in article options. It is expected that only $this->item->text cares about it. Am I right?
Note: $this->item->fulltext works as expected and outputs only the contents AFTER the READ MORE.
In case of disabling Show Intro Text parameter in article options, all of the 3 variables, return the text after READ MORE. This should really be considered as a bug.
It would be more wisely to have a variable to return only intro text (in any situation), a variable to return only full text (in any situation), and a variable to include/exclude introtext according to the article parameter: Show Intro Text
All you need to do is add a template override. You need to make a copy of this file:
/JOOMLA INSTALL/components/com_content/views/article/tmpl/default.php
Make any changes to the code that you want, then upload it here:
/JOOMLA INSTALL/templates/flexibility/html/com_content/article/default.php
Simple as that.
In Joomla 3.3.0 it just works as you expected:
<div id="introtext"><?php echo$this->item->introtext; ?></div>
<div id="fulltext"><?php echo $this->item->fulltext; ?></div>
(in templates/your_template_name/html/com_content/article/default.php)

Resources