Display cs cart recently viewed block just beside description div - cs-cart

I am using cscart4. i want to to display "recently viewed" block and product description part side by side.
I have added recently viewed block in products layout. But product description is in part of "main content" grid. So that recently viewed block displaying under entire product detail block.
finally my question is how can we merge any block with in the template content?
Can anyone help me.

You cand do this in 2 ways:
Create a new block with smarty support. Add in this capture for product description:
{$smarty.capture.$prod_descr nofilter}
Move it with jQuery
2.1. Create a new block with only one div who has class like this: class="block-desc"
2.2. in index.tpl add this code:
<script type="text/javascript">
$(".block-desc").html($(".ty-product-block__description"));
$(".ty-product-block__description").html("");
</script>

Related

How to display for static block pages for magento1.9.0.1?

i created staticblock pages in admin panel(magento ver1.9.0.1),but while creating pages the storeview tab is missing..so,i'm unable to create a layout for my staticblock pages.please check the image below:
If you have single store, then it will not asking for store view.
which error message you got while saving static blocks ?
Answer :
1. Add CMS Block with Banner
- http://www.awesomescreenshot.com/image/2010900/2819f42368db4893663d47c2a54d9b51
Add layout update for banner
Find home page in CMS pages Section
"Design" Tab
Layout Update XML
banner-static-block-identifier
Save It.
{{THEME PATH}}/template/page/html/header.phtml
Add this line where you want.
getChildHtml('banner-static-block-identifier') ?>
If you have only one website with single store or storeview then it will not be display.
Please first create at least one extra store.

Adding Joomla Article Order number inside an article

I am trying to create a Joomla site that would be showing the article order numbers (not Article ID) inside each article. that way I can handle it like a book.
Each page will show the article order number at the corner - like a page.
That way I will be able to have the site modeled by categories and pages will show with their page number (Article Order number) at the corner.
I want to give the user the ability to watch the pages like they are reading books by categories.
I would be happy to know - how can I add the article order number (for each category) inside the article itself.
I am sure that there is a PHP code that can do that.
Thanks so much for your help and assist.
Arye
You'll need to override the default article layout in your template.
If your template doesn't already have an article layout, you can copy the default layout from components/com_content/views/article/tmpl/default.php inside your template override templates\[YOURTEMPLATE]\html\com_content\article\default.php (replacing [YOURTEMPLATE] by your actual template name.
You can then display ordering where you require it within your template by using
<?php echo $this->item->ordering; ?>
You'll most likely want to either check for a certain condition (the article's category, perhaps) to determine whether you want to display the ordering.
Another option is to create an alternative layout instead of overriding the default one. You can rename default.php in your template to, let's say bookpage.php. You will then be able to pick the new layout as an alternative layout in your articles' options.
you can get article id by using
Request::getVar('id');
for more you can check the link
Joomla plugin : how to get article title and article id
for jquery you can do like this. you can create a function and call on every page load it will sort all your content accordingly. you can assign other attributes also in foreach loop.
<div id="allArticles">
<article id="3">Article 3</article>
<article id="1">Article 1</article>
<article id="2">Article 2</article>
</div>
$("#allArticles article").sort(function (a, b) {
return parseInt(a.id) > parseInt(b.id);
}).each(function(){
var elem = $(this);
elem.remove();
$(elem).appendTo("#allArticles");
});
more you can see the working example here http://jsfiddle.net/THMu3/

Page title showing up as site title on articles that do not have a menu item associated joomla 3.2

On all my Joomla pages I have the articles title as the h1 tag, so until now, Joomla has always displayed the title, i.e. what you see on the browser tab as the h1 tag. (There were one and the same thing).
However, this is not the case with all the pages that have no menu item linking to them, (they are linked to the rest of the site through another article). Here the name of my site is the page title.
How do I make the h1 tag the page title on these pages?
Try this,
This is happen due to those article pages meta options have title, Meta tag and keywords those are blank or not set yet. Then this case Joomla will read those info from your Global settings It may have your site name and Global description.
So the solution is set the Proper meta info for those articles from article manager.
If it is not practical then you can try it from article view or layout page Set meta data of Joomla page
Second Method is for setting the page title forcefully from scripts. It used for any components like here you have to check first method it will work for you..
Hope its Helps..
Problem solved! Here is how:
Make an override of com_content article and edit the default.php. Around lines 42/43 you should have the following code (the line number may not be exact as I have already taken out some code for a previous override):
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
Straight after that, add the following lines of code:
<?php $document=& JFactory::getDocument();
$document->setTitle( $this->item->title ); ?>

Run code if inside a specific category

Hi there I'm trying to display html code on certain pages in Joomla 3.0 depending on what category they're in - I've tried this but it won't work and displays nothing;
<?php $catid = JRequest::getInt('catid'); if ($catid == 14) {?>
HTML CODE GOES HERE
<?php } ?>
Any help would be greatly appreciated .
Rather than hardcoding this in to your site, just use Advance Module Manager and a Custom HTML module. This will make it trivial to change/add/delete what you want to display and where you want to display it.
First, create a menu item for each category if you don't already have one. If you do not want the links to show anywhere, create a new menu for the links and do not assign it to a module.
Next, install Advance Module Manager. For each category, create a new Custom HTML module with what you want to display. Then just assign the module to display for the menu item you created in the first step.

Magento widget rendering in non-CMS content

Is there a simple way to hook into the Magento widget rendering feature on something other than CMS block or page?
I have a tooltips extension to display tooltips on custom options. There will be lots of products all with the same options and all needing the same tooltip text. While the tooltip extension we're using provides a means to declare snippets that can then be used on products, the snippets are added to individual products at setup time rather than referencing the single snippet instance. Thus if the tooltip content needs to change across all products we have to edit the snippet and then reapply the modified snippet to all products.
It would be preferable to be able refernce the snippet direct rather than just using it at product setup, but that's not how it works. So an alternative would be to include a static block in the tooltip description and reference the single description instance with our theme's already provided widget feature that works for on CMS pages e.g. {{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="xx"}}, where xx is the block created for this tooltip.
This needs the tooltip HTML description parsed through whatever it is in Magento that parses content HTML and processes any widget directives it contains.
I tried the following, where $tipstext is the tooltips HTML containing the widget directive, but no go. Didn't think it would be that simple!
Mage_Cms_Model_Template_Filter::filter($tipstext);
Anyhone have any idea if/how this could be achieved easily?
The class Mage_Cms_Model_Template_Filter does not have a widgetDirective method so it does not know how to parse {{widget}} short codes. Try instead Mage_Widget_Model_Template_Filter:
Mage::getSingleton('widget/template_filter')->filter($text);
This should work
<?php
$filter = new Mage_Widget_Model_Template_Filter();
$_widget = $filter->filter('{{widget type="cms/widget_page_link" template="cms/widget/link/link_block.phtml" page_id="2"}}');
echo $_widget;
?>

Resources