i need to remove short description in the view.phtml and replace with attribute.phtml tab...how to do it? Thanks.
Edit your theme's template/catalog/product/view.phtml (not the base theme's, that can get overwritten) and replace this:
<?php if ($_product->getShortDescription()):?>
<div class="short-description">
<h2><?php echo $this->__('Quick Overview') ?></h2>
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
</div>
<?php endif;?>
with this:
<?php echo $this->getChildHtml('additional') ?>
And further down where you see the same line delete it. This avoids duplication.
Related
How to i get Events previous and next Event in contao detail page and list page ? f.e < Previous Event | Current Event ( id - 4) | Next Event
Blockquote
There is no extension for Contao 3 that I know of. However, you could do the following.
Insert the following PHP code at the top of your event_full template:
<?php
$this->getEventUrl = function($objEvent)
{
global $objPage;
return \Controller::generateFrontendUrl($objPage->row(), '/' . $objEvent->alias, null, true );
};
$objNextEvent = \CalendarEventsModel::findOneBy(
array("startDate > ?", "published = '1'", "pid = ?"),
array($this->startDate, $this->pid),
array('order' => 'startDate ASC'));
$objPreviousEvent = \CalendarEventsModel::findOneBy(
array("startDate < ?", "published = '1'", "pid = ?"),
array($this->startDate, $this->pid),
array('order' => 'startDate DESC'));
?>
This will try to fetch the previous and next event in the most simple way.
Insert the following somewhere in your event_full template (e.g. before the last closing </div>:
<?php if ($objPreviousEvent || $objNextEvent): ?>
<div class="pagination">
<?php if ($objPreviousEvent): ?>
<div class="prev">
<a href="<?= $this->getEventUrl( $objPreviousEvent ) ?>" title="<?= $objPreviousEvent->title ?>">
« <?= $objPreviousEvent->title ?>
</a>
</div>
<?php endif ?>
<?php if ($objNextEvent): ?>
<div class="next">
<a href="<?= $this->getEventUrl( $objNextEvent ) ?>" title="<?= $objNextEvent->title ?>">
<?= $objNextEvent->title ?> »
</a>
</div>
<?php endif ?>
</div>
<?php endif ?>
This will echo the URLs to the previous and next events within some HTML code.
There are some drawbacks:
the code above does not consider the start and end fields
this will only show the previous and next event of the same calendar (otherwise the target URL might be wrong)
this will only work with an enabled auto_item parameter
Update: I have created a Github Gist here: https://gist.github.com/fritzmg/aa4632be2231d77e7d6ec0e5e0a854ae
Is there a way to see the methods lists that is being called in the shopping cart view.
<ul class="checkout-types">
<?php foreach ($this->getMethods('methods') as $method): ?>
<?php if ($methodHtml = $this->getMethodHtml($method)): ?>
<li><?php echo $methodHtml; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
This code is in the views anywhere the "Proceed to Checkout" button shows up but my Paypal Express button isn't in the list. I can trace it back to the Block abstract but then the code looses me (ie what calls setChild to make 'methods' a child and to give it a block?).
in the objects list generated with the admin generator, the batch Action are shown in a select with a submit button.
I want to transform it and get only link (for example i have the action delete and i want to have a link to delete instead of choosingthe action and than click on the button.)
i have the _list_batch_actions.php file but i could'nt see how to get the href for the tag:
<li class="sf_admin_batch_actions_choice">
test // this is what i added but not woorking
<select name="batch_action">
<option value=""><?php echo __('Choose an action', array(), 'sf_admin') ?></option>
<option value="batchDelete"><?php echo __('Delete', array(), 'sf_admin') ?></option>
</select>
<?php $form = new BaseForm(); if ($form->isCSRFProtected()): ?>
<input type="hidden" name="<?php echo $form->getCSRFFieldName() ?>" value="<?php echo $form->getCSRFToken() ?>" />
<?php endif; ?>
<input type="submit" value="<?php echo __('go', array(), 'sf_admin') ?>" />
</li>
Any idea on how i can use it ?
Solution one:
The batch actions are submitted by form by default. You can rewrite the template to put links instead of a form.
Check your auto generated controler in the cache
(you need before to see your admin page in order to generate the cache).
apps/backend/dev/modules/autoYourModule/actions/action.class.php
You will find a function executeBatch().
You can copy this function and put it in your admin module controler and then modify its behaviour in order to do what you need.
Solution two:
Use javascript to hide your form and put a link which will select the delete action in your select box, the submit the form using javascript.
Is there any drawback in Symfony when generating modules without the --non-verbose-templates option?
I can only see that whenever you change the model, you also have to change the _form partial by hand.
Thanks
The difference is that verbose-templates expands the form. For example, in a non-verbose-template the output is:
//..
<?php echo $form ?>
//..
and in a verbose-template:
//...
<tr>
<td><?php echo $form['field_1']->renderLabel() ?></td>
<td><?php echo $form['field_1']->renderError() ?></td>
//etc..
</tr>
//etc.
//...
I'm using Symfony 1.4 and wondering whether it's possible to achieve the following:
<span>Text</span>
... using Symfony's link_to helper?
Of course, it's possible to do this:
<span>Text</span>
But I'm wondering if there's a simpler way to do it, especially as combining i18n with the above will produce:
<span><?php echo __('Text') ?></span>
... a tag soup basically.
Thanks.
YOu can do it two ways...
Option 1
<?php echo link_to("<span>".__('Text')."</span>", $url); ?>
Option 2
<?php echo content_tag('a', "<span>".__('Text')."</span>", array('href' => url_for($url))); ?>
There's also:
<?php echo link_to(content_tag('span', __'Text', array('class' => 'span-class')), '#route', array('class' => 'link-class'));
I added the attribute class for each of the two HTML tags as options if you need to extend that way.