Linking intro image in Joomla 3.3.1 - joomla

I would like to turn all intro images on the blog layout to links to the articles just as read more does.
Found this post here:
Joomla 3.1 intro image as read more link
The solution here is to replace the code in default_item.php from this:
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
To this:
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/> </a>
Followed the instructions, added an override folder in my template, copied default_item.php to it and made the change to the code. Nothing happened. I then tried to change the same lines in the component folder just to see if the problem was with the template override, nothing.
Is there another way of doing this?
Thanks in advance,
Guy.

default_item.php is only used as part of the featured articles view. If you are using the blog view, then the files appear under com_content/views/category/
The image itself is generated under com_content/views/category/blog_item.php on line 35
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
Change this to (via your template override)
<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>
</a>

Related

Joomla/Jomsocial PinMe template I want to replace the PinMe Avatar with JomSocial's Profile image

Hi I am using TemPlaza's PinMe template with the Jomsocial community component in Joomla! 3.0.3 Stable [ Ember ]
What I am looking for a very simple solution to having the Jomsocial avatar (Profile Image) replace the PinMe image on the Pins which
uses joomla core for image and profile
Jomsocial offers this:
Use JomSocial Avatars
To acquire a path to a JomSocial Avatar, you can simply request a cUser object and call a simple getThumbAvatar function to retrieve the avatar url.
include_once JPATH_ROOT.'/components/com_community/libraries/core.php';
// Get CUser object
$user = CFactory::getUser($userid);
$avatarUrl = $user->getThumbAvatar();
echo '<img src="'.$avatarUrl.'">';
The PinMe template is coded as such:
<?php if(isset($this->s_user) && $this->s_user==1){ ?>
<div class="TzAuthor">
<?php if(isset($Pins->user_img) && !empty($Pins->user_img)){ ?>
<img class="tz_pin_img_user" src="<?php echo JUri::root().'/'.$Pins->user_img; ?>">
<?php }else{ ?>
<img class="tz_pin_img_user" src="<?php echo JUri::root().'/components /com_tz_pinboard/images/avata.jpg'?>">
<?php }?>
<div class="TzAuthorInfo">
<a class="tz_pin_name_user"
href="<?php echo Route::_(TZ_PinboardHelperRoute::getPinboardManageruserRoute($Pins->id_user)); ?>" rel="nofollow">
<?php echo $Pins->user_name; ?>
<?php if(isset($Pins->name_user_repin) && !empty($Pins->name_user_repin)){
?>
<strong class="tz_by">
<?php echo JText::_('COM_TZ_PINBOARD_MANAGERUSER_REPIN_BY'); ?>
</strong>
<?php
echo $Pins->name_user_repin;
}
?>
</a>
spoke with the PinMe people and the cost for custom code isnt worth it and the sites on my local not live
to reiterate
all I am looking for a very simple solution to having the Jomsocial avatar (Profile Image) replace the PinMe profile image on the Pins
how do i make this happen

Magento new products widget blurry

The small images of Magento's (1.9.0.1.) built in new products widget are blurry. I am using the default rwd theme and it does not seem to happen to other widgets such as recently viewed products.
It also displays on multiple rows instead of alongside each other.
Sorry I can't post pictures yet
Thanks!
I found a solution:
The image resizing is the 'new.phtml' file, but the theme RWD does not have this file.
Copy the file app/design/frontend/base/default/template/catalog/product/new.phtml
to app/design/frontend/rwd/default/template/catalog/product/ and change the size in line 35.
Old:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135"
New:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(272) ?>" width="272" height="272"
I changed to 272 to not get blurred.
This worked for me on magento 1.9.2:
Edit this file (if there isnĀ“t this file, copy from base/default theme):
app/design/frontend/rwd/default/template/catalog/product/new.phtml
And then replace the < a > tag with this code at line 35:
<?php $_imgSize=300; ?>
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize) ?>" width="<?php echo $_imgSize ?>" height="<?php echo $_imgSize ?>" alt="<?php echo $this->escapeHtml($_product->getName()) ?>" />
Allright I found a solution:
I had to modify a line in new_grid.phtml in app/design/frontend/[rwd]/default/template/catalog/product/widget/new/content
Change the 85 to 210 in this line:
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(210) ?>" alt="<?php echo $this->stripTags($_product->getName(), null, true) ?>" />

I have a script, in yii. That almost does the job, need just a little push

I am not a programmer by any means. I purchased the script and have spent two weeks and many variations trying to get the code to do what I need. It is 'almost' there.
<div id="step-2" style="position:absolute; center:overflow-y:;">
<?php if($images): ?>
<?php foreach ($images as $img => $data): ?>
<a href="javascript:;" class="pin-img">
<img src="<?php echo $img ?>" />
</div>
</a>
<?php endforeach; ?>
<?php else: ?>
<h2><?php echo Yii::t('yii', 'No relevant found!') ?></h2>
<?php endif ?>
</div>
It returns the images from a site. It only lets me select the first image. Even though all images are displayed. Only one is actually clickable. If I hover over each of the images I see the javascript href. I understand that to be some sort of place holder. that just makes the browser show the hand.
I just need the script to allow each item to be a choice for reaction.
http://silenceisnotawkward.com/Sinapin/Script/# is the live code.
I have made a test user
Test=user
Password =password in case anyone wants to see what the site does.
http://www.ew.com/ew/ is a good link to pin from website and see the behavior.
I didn't look at your site, but looks like you are confusing your nesting of HTML tags, because you introduced a end-of-dev tag in your link.
<div id="step-2" style="position:absolute; center:overflow-y:;">
<?php if($images): ?>
<?php foreach ($images as $img => $data): ?>
<a href="javascript:;" class="pin-img">
<img src="<?php echo $img ?>" />
<!-- I removed the < / div > from here -->
</a>
:
<?php endforeach; ?>
</div
>
HINT: I indented the code to make it more readable, Try doing the same with your code you posted and see where it leads you.

Header logo image shows at home page but not others

I'm using Mgto 1702 with hellowired template. I have various stores that follow the subfolder method (www.domaian.com/store). The header image logo and the Alt text file is in its folder. When you visit www.domain.com/store1 or /store2, etc the right logo appears on the home site header. When I click on any link to change pages (for example, a product page) the header shows correctly but NOT the image.
The header.phtml file includes an If that asks if it's the Home page (getIsHomePage()):?> but that doesn't really matter. I placed the code outside the If clause and the problem persists. I added a "trick" echo clause to follow the behaviour in all cases. The text appears but not the JPG.
Any suggestions?
Thanks
<?php // if ($this->getIsHomePage()):?>
<h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></h1>
<?php /*else:?>
<strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />
<?php endif */?>
please remove the condition as shown above in the header.phtml page to get the same header in all the pages.

Magento categories listing using getCollection & addLevelFilter but exclude Default Root Category

I'm using the following code to grab a collection and to filter on a level using addLevelFilter(2). This outputs all my categories at level 2 perfectly except it also pulls through the Default Root Category in my list. I want to exclude this from view but having looked through all the available methods, I see nothing that will help me remove/exclude certain levels or categories. I really want a full proof solution so if I were to choose say level 3 it would only show level three and not level 1,2,3. Does anyone have a suggestion to pull only a certain level/categories!!??
<?php
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*')
->addIsActiveFilter()
->addLevelFilter(2)
->addOrderField('name');
foreach($categories as $category):
?>
<div class="home-cats">
<div class="product-image">
<a href="<?php echo $category->getURL() ?>" title="<?php echo $this->htmlEscape($category->getName()) ?>">
<img src="<?php echo $category->getImageUrl() ?>" width="88" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
</a>
</div>
</div>
<?php endforeach; ?>
Any advice/feedback would be greatly appreciated. Cheers, Sahus
you can try
->addAttributeToFilter('level',2)
this may work for you

Resources