Joomla overrides my Quotes to &quote - joomla

I was trying to take advantage of the joomla class input by entering scroll-link" data-id="home so the output would be: <a class="scroll-link" data-id="home" href="#homes">Home</a> but instead joomla outputs: <a class="scroll-link" data-id="home" href="#homes">Home</a> Is there any way to turn off the conversion to &quot?

The correct way to do this is by overriding your menu module's output and adding the data-id attribute. Read more about layout overrides here - http://docs.joomla.org/Layout_Overrides_in_Joomla
What you're trying will not work since the class suffixes are most probably escaped to avoid incompatible characters.

Related

th:replace doesn't work well with th:with in Thymeleaf

According to Thymeleaf docs
Fragments can include any th:* attributes. These attributes will be evaluated once the fragment is included into the target template (the one with the th:insert/th:replace attribute), and they will be able to reference any context variables defined in this target template.
My Fragment
<div th:fragment="link">
<a th:href="#{${url}}"><span th:inline="text">[[${text}]]</span></a>
</div>
This is how I include it.
<div th:replace="fragments/common :: link" th:with="url='www.google.com', text='Click Me'"></div>
The html i get
<a href="">
<span>null</span>
</a>
However the same works fine with th:include and gives me following HTML.
<a href="www.google.com">
<span>Click Me</span>
</a>
Why th:replace doesn't work while th:inlcude works fine?
NOTE: th:insert is out of scope because i am using Thymeleaf v2.1.5
The reason is that th:replace actually removes current tag so you lose every attribute you had there, but get all the attributes from fragment. And in your case this means that you never defined any th:with variable in the scope.th:include works the opposite way. You loose fragment tag, but keep everything defined in layout.
Consider this fragment:
<fragmenttag th:fragment="link" style="background-color: red">...</fragmenttag>
And layout:
<layouttag th:include="fragments/common :: link" style="font-size: 250%;"/>
<layouttag th:replace="fragments/common :: link" style="font-size: 250%;"/>
The result is:
<layouttag style="font-size: 250%;">Some Text</layouttag>
<fragmenttag style="background-color: red">Some Text</fragmenttag>
If you want to use th:replace, because you have some important attributes in fragment, you can define everything you need in some parent tag in layout.
<body th:with="url='www.google.com', text='Click Me'">
<div th:replace="fragments/common :: link" ></div>
</body>
You are referencing documentation in your post:
Fragments can include any th:* attributes. These attributes will be
evaluated once the fragment is included into the target template (the
one with the th:insert/th:replace attribute), and they will be able to
reference any context variables defined in this target template.
And i don't see any contradiction here, because this part of the documentation is about th:* attributes inside a fragment.
Fragments (th:fragment part) can include any th:* attributes.
And in your question you are talking about loosing th:* attributes defined in target template. But anyway, this part is quite strait that you perform inclusion logic first
These attributes will be evaluated once the fragment is included
There is nothing here that lets you assume that you will get everything you defined in target template or fragments main tag, because both of them can be replaced depending on witch inclusion strategy you are going to use (th:insert/th:replace).
So you defined th:with="url='www.google.com', text='Click Me'" attribute, but it was never included in the end result template because you selected th:replace inclusion strategy, so th:with attribute was never evaluated and you got no url and text variables in scope. No contradiction here.
Seems like a similar (not same) issue thank the one mentined in this post
As a workaround for this issue you can still use th:include and then remove the extra div by using th:remove="tag", something like:
<div th:include="fragments/common :: link" th:with="url='www.google.com', text='Click Me'" th:remove="tag"></div>

Implementing the 360 magic spin in smarty

I can't integrate the 360 magic spin in smarty templates. While adding the following code
<a class="Magic360" href="assets/spin-images/Bar-360-01.jpg" data-magic360-options="filename: Bar-360-{col}.jpg;">
While adding the attribute of data-magic360-options with filename, the screen will goes blank.
I amusing smarty 2.x.
Smarty (PHP framework) counts all strings {..} like its own directives.
To avoid that, you should use the following code:
{literal}<a class="Magic360" href="assets/spin-images/Bar-360-01.jpg" data-magic360-options="filename: Bar-360-{col}.jpg;">{/literal}
or
<a class="Magic360" href="assets/spin-images/Bar-360-01.jpg" data-magic360-options="filename: Bar-360-{ldelim}col{rdelim}.jpg;">
Did you forget $ sign for col variable?
data-magic360-options="filename: Bar-360-{col}.jpg;"
Maybe you should use {$col}:
<a class="Magic360" href="assets/spin-images/Bar-360-01.jpg" data-magic360-options="filename: Bar-360-{$col}.jpg;">

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)

Correct way to call a product page using a static block in Magento

I have a content slider setup and works correctly, but when try to add a url to the content navigation I am still seeing my placeholder (#) in the link instead of see the link. What is the correct way to call a product in a static block? I tried using something along the lines of this:
<ul id="nav1">
<li><input id="array_text_0" type="hidden" value="<li></li>"/></li>
<li><input id="array_text_1" type="hidden" value="<li></li>"/></li>
<li><input id="array_text_2" type="hidden" value="<li></li>"/></li>
</ul>
however the link does not change from (#)
I have just tested with a product at /frame.html. To link to that page in a static block I used {{store direct_url="frame.html"}} (the use of direct_url, instead of url, removes the trailing slash.)
I assume you've got caching disabled? If not, disable it and try again.
Edit: There's also the fact that you've used double-quotes to wrap the arguments and in the value. You'll either need to escape the double-quotes you're using as a value, or use single-quotes.

Blogger template: Style blog post based on label

I'm trying to change the style of a blog post (for instance change the title color), based on the labels associated to the post.
I'm a bit new to the templating, so I though I would be going to add a class with the label in the title <h3> element, and then add my CSS rules.
So I found this which would generate a proper list of labels separated by a space:
<b:loop values='data:post.labels' var='label'><data:label.name/> </b:loop>
However, it seems the validator does not let me add this inside the class attribute as follow:
<h3 class='post-title entry-title <b:loop values="data:post.labels" var="label"><data:label.name/> </b:loop>'>
From there, I found half the solution. Apparently, I should use expr:class instead of class as follow:
<h3 expr:class='"post-title entry-title " + data:list_of_labels'>
So now:
- How can I build this variable data:list_of_labels? (basically how to set a variable)
- Is there a full description of the template syntax somewhere?
- Is there another way to go around this?
Thanks,
JB
This should do it. Using XML entities allows you bypass the XML validation and move the Blogger functions to where you need them. Longer explanation here: http://www.karlhorky.com/2012/06/add-blogger-labels-to-post-as-css.html
<div class="post<b:if cond="data:post.labels"><b:loop values="data:post.labels" var="label"> <data:label.name></data:label.name></b:loop></b:if>">
<data:post.body>
</div>
There is no way to set variables in the blogger data xml, however you can set variables using javascript.
There are many pages on the blogger data xml. Google is your friend. For example this one.
You are on the right track: do a loop, use javascript to check for the combinations you want, change the style properties or load a css file dynamically.

Resources