I have create a custom menu in frontend in magento 2 - magento

using code
<a href="<?php echo $this->getBaseUrl()."become-a-reseller.phtml"; ?>" class="level-top ui-corner-all" role="menuitem" >
<span><?php echo __("Become A Reseller")?></span>
</a>
in topmenu.phtml file . and i want to redirect this href to become-a-reseller.phtml file which is located at app/design/my_theme/dreamshop/magento_theme/templates/html folder then what should be the path in anchor tag href

Related

overlapping url codeigniter

i am having a career page with apply now button
<a class="btn-system btn-medium" href="apply/<?php echo $job->id;?> " style="box-shadow:none !important;">Apply Now</a>
now i have mwentioned the route for this anachor tag as
$route['apply/(:any)']='welcome/apply/$1' ;
Now when i click to my header navigation which has the following link :
<ul class="nav navbar-nav navbar-right">
<li>Home</li>
<li>About Us</li>
<li>Services</li>
<li>Portfolio</li>
<li>Blog</li>
<li>Career</li>
<li>Contact</li>
</ul>
It generates the link as base_url/apply/home thus not giving me the homepage or any other content
It is overlapping the link..Can neone help?
Prepend "link" with slash so it will be read from the root. Like
<a class="btn-system btn-medium" href="/apply/<?php echo $job->id;?> " style="box-shadow:none !important;">Apply Now</a>
I would put all of that in PHP with
<a class="btn-system btn-medium" href="<?php echo \"/apply/$job->id\";?> " style="box-shadow:none !important;">Apply Now</a>
Or as mentioned in comment by #RajJagani put it into base_url() function:
<a class="btn-system btn-medium" href="<?php echo base_url('apply/'.$job->id');?> " style="box-shadow:none !important;">Apply Now</a>

how to change url of "add to wishlist" button in magento

I am designing a magento website and I am new to it. I am unable to find where to change the URL of Add to Wishlist button.
I have attached the screenshot to check if someone needs.
I will be obliged if someone provides a solution.
addtowishlist
You can change the URL from the following template file:
template/catalog/product/view/addto.phtml
Go to
your_theme > default > template > catalog > product > view > addto.phtml
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist">
<?php echo $this->__('Add to Wishlist') ?>
</a>
<?php endif; ?>
Here you can change href.

How to use Microdata for URLs in Joomla?

I read here about Microdata in Joomla. However, I'm not able to produce a link with Microdata.
I want a Microdata output like:
<a itemprop="url" href="http://someurl">
<span itemprop="name">Some Url</span>
</a>
I want a link to an organisation from my client's website. My code is:
$microdata = new JMicrodata('Organization');
<div <?php echo $microdata->displayScope();?>>
echo $microdata->content( $this->item->url )->property( 'sameAs' )->display();
// outputs <span itemprop="sameAs">www.url_of_company.com</span>
</div>
Both url and sameAs Schema.org properties are of type URL, as per my understanding.
I also tried to wrap it with an anchor tag but Joomla is not producing itemprop along with href attribute in anchor tag.
I must be missing something.
Ok I analysed in libraries/joomla/microdata/microdata.php the method display();
and it doesn't exist any way to produce a <a href="#" > tag, only div, span and meta.
Btw there is a static method called htmlProperty(), with that you can add the property you need.
<?php $microdata = new JMicrodata('Organization'); ?>
<div <?php echo $microdata->displayScope(); ?> >
<a <?php echo JMicrodata::htmlProperty('url'); ?> href="http://google.com">
<?php echo $microdata->content('Google')->property('name')->display(); ?>
</a>
</div>

Linking intro image in Joomla 3.3.1

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>

Show a single image based on product Id

I've created a module to show YouTube videos on a CMS page in Magento by pasting the videoId into a text field for each product, the video then shows on each custom CMS product page. The problem I have now is I need to pull a single image for the 'Play' button which is the logo for each product but I am not sure how to this.
I've tried creating another attribute called videothumbnail and selecting media image bot I can't see the field in the manage products section so I am a bit stuck.
This is the code that shows the YouTube video for each page. You will se that the image I currently have will show on all CMS page even if they are different products I need to assign an image to each page if possible.
<?php $_product = Mage::getModel('catalog/product')->load($this->getProductId()); ?>
<?php if ($_product->getId() && $_product->getVideoid()): ?>
<ul class="list">
<h3 class="product-name">Video</h3>
<li> <a class="fancybox-video" href="http://www.youtube.com/embed/<?php echo $_product->getVideoid(); ?>">
<img src="<?php echo $this->getSkinUrl('images/x5-play.png');?>" /></a> </li>
</ul>
<?php endif;?>
Assuming that you create a new media image called videothumbnail
By going to Admin -> Catalog -> Attribute -> Manage Attribute
Then create a new attribute of 'Media Image' for 'Catalog Input Type for Store Owner'
Then add it to a 'Manage Attribute Sets' in Admin -> Catalog -> Attribute
(you may need to do a reindex to catalog flat table)
<?php $_product = Mage::getModel('catalog/product')->load($this->getProductId()); ?>
<?php if ($_product->getId() && $_product->getVideoid()): ?>
<ul class="list">
<h3 class="product-name">X5 Mop Video</h3>
<li>
<a class="fancybox-video" href="http://www.youtube.com/embed/<?php echo $_product->getVideoid(); ?>">
$_helper = Mage::helper('catalog/output');
$_img = '<img id="image" src="' . Mage::helper('catalog/image')->init($_product, 'videothumbnail')->resize(410,420) . '" width="410" height="420" />';
echo $_helper->productAttribute($_product, $_img, 'image');
</li>
</ul>
<?php endif;?>
For less faff, but less control, you can pull a live thumbnail from YouTube very easily if you have the video ID:
How do I get a YouTube video thumbnail from the YouTube API?
You should consider using this as a fallback for if the product has no Magento video thumbnail specified.

Resources