I faced a strange issue with Joomla default Articles option with custom module.
In joomla article section when I enter some text like
Price is $20 its not displaying on the site front end. When I use with a space $ 20 It works fine.
This article is showing on the front end with custom module,
Like this article content is reading from DB using a custom module and out put like
echo $fullArticle = JHtml::_('content.prepare', $values->introtext);
This module is loading inside another article with {loadposition mypostion}
When I put $20 directly in any other article its works fine, I think using custom module and loading position time the Joomla thinks $20 as a variable or something ?
Please help me to resolve this issue!
Solved the issue myself,
I created a content plugin and in that all $ symbol replaced with $ I its works!
something like,
$article_content = str_replace('$','$',$article->text);
Hope this may help someone else in future.
Related
I'm trying to display manufacturer in category view using Prestashop 1.7.
Prestashop 1.7 uses a new file system with partials, the file I'm trying to edit is located in /themes/your_theme/templates/catalog/_partials/miniatures/product.tpl
I've been researching and trying a few things like {$product.manufacturer_name} which seems to be correct, It's declared in Product Class, but somehow it doesn't works.
Any clue about this?
Thank you!
Finally found the solution, this .tpl view has access to id_manufacturer but not manufacturer_name, thats weird, but I finally managed to get the manufacturer name using this code:
{Manufacturer::getNameById((int) $product.id_manufacturer)}
You have to be inside this file:
/themes/your_theme/templates/catalog/_partials/miniatures/product.tpl
Hope it helps
Having just got myself acquainted (enough) with Magento 1.9, and able to make the customisations required, I've been told that once it's out, we're moving to Magento v2.0.
Having found the differences in the file structure, I believe I can see where to place my code for the custom pages we use, but how can I add this page from my project to a static block for later use?
Previously, the method used was as follows (I realise this may not follow the best practise, but it worked):
Create element folder within theme or core templates directory.
eg. /app/design/frontend/<theme>/default/template/myelement/mypage.phtml
Add this page/element to a static block using the following in the content editor:
{{block type="<theme>/default" template="myelement/mypage.phtml"}}
This block can then be added to the category pages as required.
In Magento 2, I have tried what I believe to be required, which is replicating the file structure and adding phtml files to this, so the template file now resides in:
/app/code/<supplier>/<module>/view/frontend/templates/mypage.phtml
Adding to the content editor the following:
{{block type="<supplier>/<module>" template="mypage.phtml"}}
Unfortunately, this does not display the intended page (element). It doesn't display the calling "{{block" entry either, which usually happens when the line is invalid, so I can only assume that I'm missing something with the link to this template.
If anyone can offer some assistance with this, I would be most grateful.
EDIT:
Continued research on this has led me to the following assumptions:
Magento 2 requires more than just a new .phtml page, even for simple customizations.
I'm still missing something.....
Having gone through 3 different tutorials on creating new modules for Magento 2, each providing slightly different methods, but fundamentally being the same thing, I now have what I believe should be all the code elements to make a new .phtml template for display in a static block.
This has led to an additional problem though.
While I have the required code, I cannot add the module. Adding the module to etc/config.php, as suggested in 2 out of the 3 tutorials, simply crashed M2, both admin and frontend when you try to clear the cache. This is the case after manually clearing cache folders in the var directory.
Also, still unable to add the .phtml template file to a static block or page using content editor.
Not much hair left to pull out here, so looking for help! Thanks in advance
There are a few samples on GitHub, including https://github.com/magento/magento2-samples/tree/master/sample-module-newpage which shows a module adding a new page with a very simple PHTML template file. This example does not use CMS content editing however - it is a sample based on using layout files.
You mentioned you were getting crashes. Would need more details to help on that one. If you got it solved, could you update this question and accept a response to close it out? Thx!
You Should try "class" instead of "type". So your code should look like.
{{block class="<package>\<module>\Block\MyBlock" template="mypage.phtml"}}
You Should try "VenderName_Modulename::myelement/mypage.phtml" instead of "myelement/mypage.phtml". So your code should look like.
{{block class="VenderNameModulename\Block\MyBlock" template="VenderName_Modulename::myelement/mypage.phtml"}}
I've just had to reinstall Joomla as the template didn't seem to display correctly.
It should look like this demo
http://demo.joomla-monster.com/190-jm-lifestyle
But it looks like this.
www.ultimatemuscleperformance.co.uk
Does anyone have any idea why?
I'm really new to Joomla but I thought all of that would be displayed by default
*strong text*The template you've installed probably uses different named module positions to the template you were using before.
For example, lets say you assigned a login module to "position-7" (right sidebar) on your first template, you then install this new template. The module won't show because the new template uses the name "right-column" instead.
Here is a map of the module positions your template provides:
http://www.joomla-monster.com/knowledge-base-area/templates-documentation/templates-for-joomla-3-0/jm-lifestyle/template-layout
So all you need to do is assign the modules that aren't showing to a position shown on the link above
Hope this helps
When I installed the module that I developed and in the module manager screen of the backend I can see the title like this.
Module Manager: Module mod_examplemodule
So I want to change it into something like this. Module Manager: Module Example Module
I have developed few Joomla modules but so far I didn't realize how to do this.
Your help on this would really appreciated.
Thank you.
Im using Joomla 2.5.8. I have just added the screen shot. Perhaps it would be more helpful.
In my modules I use:
<name>Module Title</name>
<description>MOD_MODULE_TITLE_XML_DESCRIPTION</description>
I then add an entry in the language file for the description. This normally covers my needs
I have solved this:
You can change name tag in mod_examplemodule.xml file and install again
OR
If you have database access then in [prefix]_modules table find the record of this module and change the name field as per your requirement
I want to best rated product on a magento homepage. I have product reviewing module configured on my site.
i have tried following this http://www.odino.org/84/retrieve-top-rated-products-in-magento
but am unable to get it working.
My homepage is formed my calling one block from the cms home page {{block type="page/html" template="page/html/home.phtml"}}
and i have tried putting the php code in home.phtml
The link i have posted asks to create a helper, but i don't know how to go about that, so what i did was wrote a normal function within the page and called it.
Any help would be seriously appreciated :)
Thanks
Look at this module from Inchoo, explained with all the required changes you need to make with screenshots. Hopefully this will be helpful
http://inchoo.net/ecommerce/magento/bestseller-products-in-magento/