/** * Prepares the document * * @return void * * @throws Exception */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; $this->getUser(); // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $menulink = $menu->link; } //error_log("Active menu -->" . print_r($menu,true)); if ($menu && strpos($menulink, 'option=com_akrecipes&view=recipesbyuser') !== false) { // menu is set and menu is pointing to user page $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); $title = $this->params->get('page_title', ''); } else { //$this->params->def('page_heading', JText::_('COM_AKRECIPES_DEFAULT_PAGE_TITLE')); $this->params->def('page_heading', $this->user->name); } //error_log("Page Heading = " . $this->params->get('page_heading')) ; $sitename = $app->get('sitename'); if (empty($title) || $title == $sitename) { $title = $this->user->name; } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } if ($this->pagination->pagesCurrent > 1) { $this->document->setTitle($this->pagination->getPagesCounter() . ' ' . $title); } else { $this->document->setTitle($title); } // now set the meta description if ($menu && strpos($menulink, 'option=com_akrecipes&view=recipesbyuser') !== false) { $meta_description = $this->params->get('menu-meta_description'); } if (empty($meta_description)) { $meta_description = AkrecipesFrontendHelper::truncate_text($this->user->akprofile['aboutme'], 150); } $metaDescription_prefix = ''; if ($this->pagination->pagesCurrent > 1) { $metaDescription_prefix = $this->pagination->getPagesCounter() . ' for '; } if (!empty($meta_description)) { $this->document->setDescription($metaDescription_prefix . $meta_description); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } //$this->document->addStylesheet('media/com_akrecipes/css/recipe.css'); }
if (strpos($image, '/') === 0) { $image = substr($image, 1); } $recipe_url = JRoute::_(AkrecipesHelperRoute::getRecipeRoute((int) $item->id, $item->catid)); ?> <a href="<?php echo $recipe_url; ?> " class="list-group-item"> <h4 class="list-group-item-heading"><?php echo $item->recipe_name; ?> </h4> <p><?php echo AkrecipesFrontendHelper::truncate_text($item->recipe_description, 100, true); ?> </p> </a> <?php } ?> </div> <?php } ?>
/** * Prepares the document * * @return void * * @throws Exception */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; // Because the application sets a default page title, // We need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_AKRECIPES_DEFAULT_PAGE_TITLE')); } //$title = $this->params->get('page_title', ''); $title = $this->item->recipe_name; if (empty($title)) { $title = $app->get('sitename'); } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } $this->document->setTitle($title); // now set the meta description $metadesc = $this->item->metadesc; // if their is a menu meta, use that if ($this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } elseif ($metadesc) { $this->document->setDescription($metadesc); } else { $metadesc = AkrecipesFrontendHelper::truncate_text($this->item->recipe_description, 150); $this->document->setDescription($metadesc); } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } //$this->document->addStylesheet('media/com_akrecipes/css/recipe.css'); $this->document->addStylesheet('media/com_akrecipes/css/star-rating/star-rating.css'); $this->document->addStylesheet('media/com_akrecipes/css/star-rating/theme-krajee-fa.css'); // $this->document->addScript('media/com_akrecipes/js/star-rating/star-rating.js'); // $this->document->addScript('media/com_akrecipes/js/rating.js'); // $this->document->addScript('media/com_akrecipes/js/hits.js'); if ($this->params->get('social_media_optimization')) { $this->_prepareSocialMedia(); } }
">Edit</a> <?php } ?> <?php } ?> <div class="recipedate"> <?php echo JHTML::_('date', $recipe->publish_up, JText::_('DATE_FORMAT_LC2')); ?> </div> <div class="recipedescription"> <p><?php echo AkrecipesFrontendHelper::truncate_text($recipe->recipe_description, 300, true); ?> </p> </div> <div class="col-md-12 catBlock"> <?php $caturl = AkrecipesHelperRoute::getCategoryRoute($recipe->catid); ?> <span><i class="fa fa-folder"></i> Published in <a href="<?php echo $caturl; ?> " title="View more recipes in <?php echo $recipe->catid_title; ?> "><?php
echo $item->title; ?> "></img> <div class="caption"> <div class="catBlock"> <?php echo $item->catid_title; ?> </div> <h3 itemprop="name" class="recipe_title"><?php echo $item->title; ?> </h3> <div class="recipedescription"> <p itemprop="description"><?php echo AkrecipesFrontendHelper::truncate_text($item->intro_text, 150, true); ?> </p> </div> <div class="authorDateBlock"> <div class="recipe_author" itemprop="author"> <?php echo $item->author; ?> </div> <?php $published_datetime = new DateTime(JHTML::_('date', $item->publish_up, 'Y-m-d H:i:s')); ?> <div class="recipedate" itemprop="datePublished" content="<?php echo $published_datetime->format(DateTime::ISO8601);
/** * Prepares the document * * @return void * * @throws Exception */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $title = null; //error_log("Preparing document --> " . print_r($this->category->metadesc,true) ); // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_AKRECIPES_DEFAULT_PAGE_TITLE')); } //$title = $this->params->get('page_title', ''); $title = $this->category->title; //$sitename = $app->get('sitename'); if (empty($title)) { $title = $app->get('sitename'); } elseif ($app->get('sitename_pagetitles', 0) == 1) { $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); } elseif ($app->get('sitename_pagetitles', 0) == 2) { $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); } if ($this->pagination->pagesCurrent > 1) { $this->document->setTitle($this->pagination->getPagesCounter() . ' for ' . $title); } else { $this->document->setTitle($title); } //now set metadescription $metaDescription_prefix = ''; if ($this->pagination->pagesCurrent > 1) { $metaDescription_prefix = $this->pagination->getPagesCounter() . ' for '; } // check if meta description available from menu $metadesc = $this->params->get('menu-meta_description'); // get the category's meta description if (empty($metadesc)) { $metadesc = $this->category->metadesc; } // still empty use the category description if (empty($metadesc) && !empty($this->category->description)) { $metadesc = AkrecipesFrontendHelper::truncate_text($this->category->description, 150); } $metadesc = $metaDescription_prefix . $metadesc; $this->document->setDescription($metadesc); $meta_keywords = $this->params->get('menu-meta_keywords'); if (empty($meta_keywords)) { $meta_keywords = $this->category->metakey; } if ($this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); //$this->document->addStylesheet('media/com_akrecipes/css/recipe.css'); }
</h2> <a href="<?php echo $user_url; ?> "> <img class="img-thumbnail" src="<?php echo $image; ?> " alt="<?php echo $user->name; ?> " /> </a> <div class="caption"> <p> <?php echo AkrecipesFrontendHelper::truncate_text($user->userprofile->akprofile['aboutme'], $params->get('author_profile_limit', 100)); ?> </p> </div> </div> </div> <?php $count++; ?> <?php } ?> </div> <?php }
echo $unpublished; ?> </span> <?php } ?> <div class="recipedate"> <?php echo JHTML::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC2')); ?> </div> <div class="articledescription"> <p><?php echo AkrecipesFrontendHelper::truncate_text($item->introtext, 300); ?> </p> </div> <div class="col-md-12 catBlock"> <?php $caturl = JRoute::_('index.php?option=com_content&view=category&id=' . $item->catid); ?> <span><i class="fa fa-folder"></i> Published in <a href="<?php echo $caturl; ?> " title="View more articles in <?php echo $item->category_title; ?> "><?php
<img class="img-thumbnail" src="<?php echo $image; ?> " alt="<?php echo $recipe->recipe_name; ?> " /> </a> <?php if ($params->get('show_recipe_description', 0) == 1) { ?> <div class="caption"> <p> <?php echo AkrecipesFrontendHelper::truncate_text($recipe->recipe_description, $params->get('recipe_description_limit', 100)); ?> </p> </div> <?php } ?> </div> </div> <?php $count++; ?> <?php } ?> </div>