Лучший Ответ atulvin , 25 February 2014 - 11:32
Hi SmetDenis,
Wow! that was great. Now this appears perfect and the mail is sent as it should.
Thanks a lot.
Atul
Перейти к сообщениюЛучший Ответ atulvin , 25 February 2014 - 11:32
Hi SmetDenis,
Wow! that was great. Now this appears perfect and the mail is sent as it should.
Thanks a lot.
Atul
Перейти к сообщениюОтправлено 18 February 2014 - 16:18
Hi,
I am using the "Table item" type for listing a database. I am using its teaser template for front page view. What is the method to recreate the "Teaser" format for "Favorite" view?
Thanks
Atul
Сообщение отредактировал atulvin: 18 February 2014 - 16:19
Отправлено 20 February 2014 - 02:51
Hello,
First, I think it will be helpful to read the topics about adding layouts and customization.
I'll describe an example of making this for the "Table or Database" section of the demo website.
The alias of that application is "database" and the aliases of its items is "dbrecord".
I'll make the favorite view almost the same as teaser but with a button to remove from favorites.
So I made a copy of media/zoo/applications/jbuniversal/templates/catalog/renderer/favorite/_default.php and named it database.php. I edited this new file by adding table there and replacing div with tr. Also I wrapped "remove" button in a td:
<?php /** * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component * * @package jbzoo * @version 2.x Pro * @author JBZoo App http://jbzoo.com * @copyright Copyright (C) JBZoo.com, All rights reserved. * @license http://jbzoo.com/license-pro.php JBZoo Licence * @coder Denis Smetannikov <denis@jbzoo.com> */ // no direct access defined('_JEXEC') or die('Restricted access'); $view = $this->getView(); $this->app->jbassets->initJBFavorite(); if (count($vars['objects'])) { echo '<table>'; echo '<tbody>'; foreach ($vars['objects'] as $id => $item) { $layout = $this->app->jblayout->_getItemLayout($item, 'favorite'); echo '<tr class="jsJBZooFavorite favorite-item-wrapper rborder item-' . $item->id . '">'; echo $view->renderer->render($layout, array( 'view' => $view, 'item' => $item )); echo '<td><a class="jbbutton jsJBZooFavoriteRemove" href="' . $this->app->jbrouter->favoriteRemoveItem($item->id) . '" ' . ' title="' . JText::_('JBZOO_FAVORITE_REMOVE_ITEM') . '">' . JText::_('JBZOO_FAVORITE_REMOVE') . '</a></td>'; echo '</tr>'; } echo '</table>'; echo '</tbody>'; } else { echo JText::_('JBZOO_FAVORITE_EMPTY'); }
Then I made a "favorite" layout for the "table item" type. You can read about this in a topic I linked above. I copied positions settings and the template file from the "teaser" layout. But now we need to modify this new media/zoo/applications/jbuniversal/templates/catalog/renderer/item/dbrecord/favorite.php by removing tr:
<?php /** * JBZoo App is universal Joomla CCK, application for YooTheme Zoo component * * @package jbzoo * @version 2.x Pro * @author JBZoo App http://jbzoo.com * @copyright Copyright (C) JBZoo.com, All rights reserved. * @license http://jbzoo.com/license-pro.php JBZoo Licence * @coder Denis Smetannikov <denis@jbzoo.com> */ // no direct access defined('_JEXEC') or die('Restricted access'); ?> <td><?php echo $this->renderPosition('cell1'); ?></td> <td><?php if ($html = $this->renderPosition('cell2')) { echo $html; } else { echo ' - '; } ?></td> <td><?php echo $this->renderPosition('cell3'); ?></td> <td><?php echo $this->renderPosition('cell4'); ?></td> <td><?php echo $this->renderPosition('cell5'); ?></td> <td><?php echo $this->renderPosition('cell6'); ?></td> <td><?php echo $this->renderPosition('cell7'); ?></td> <td><?php echo $this->renderPosition('cell8'); ?></td>
So now the structure of the favorites view is almost the same as the teaser view. Some minor CSS changes might be needed depending on your website template.
Сообщение отредактировал Kess: 20 February 2014 - 02:52
Отправлено 21 February 2014 - 03:49
Hi Kess,
Thanks a lot. That was just great. You made it so simple. Though I am just a beginner in PHP it took me less than 30 min. to set it along with proper css. Actually it's almost the last stage of the project and really saved my day. My next issue pertaining to this is that the same page has to be emailed with just a button saying SEND this favorite list to Admin. I had achieved this with the component flexicontent favorites as seen in the attached file using output buffering. But am unable to achieve the same in this case.
Attached is the jbzoo file which includes the form code.
The path is media/zoo/applications/jbuniversal/templates/catalog/renderer/favorite/database.php
Any help on this is greatly appreciated or you can suggest another method that I can try.
Thanks again.
Atul
Отправлено 24 February 2014 - 10:20
Hi Kess,
For your reference : the path for flexicontent file mentioned herein is
components/com_flexicontent/views/favourites/tmpl/default.php
Thanks
Atul
Отправлено 24 February 2014 - 19:50
Hi , atulvin
I saw your files for submit favorite table, and I didn't find any errors there.
Could you tell me, please. What is error appeared when you try to submit the form?
Thanks.
— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.
Отправлено 25 February 2014 - 02:50
Hi,
Thanks for the update.
When the form code is applied, the template breaks and the list is shown without the form submit button etc.
I have attached the screen shot of the jbzoo file without and with the form code in place.
Thanks and Regards,
Atul
Отправлено 25 February 2014 - 06:49
$config = new JConfig(); $sender = array($config->mailfrom, $config->fromname);
— Есть два типа людей: Кто еще не делает бекапы и кто уже делает бекапы.
Отправлено 25 February 2014 - 11:32 Лучший Ответ
Hi SmetDenis,
Wow! that was great. Now this appears perfect and the mail is sent as it should.
Thanks a lot.
Atul