Posts

Showing posts with the label CMS

Joomla DB Queries

Consider two types of queries into the Joomla database by its own means. The code was written for CMS version 3. Perhaps in the versions below it will also work, but it was not checked. For clarity, the examples will be wrapped in a function. The first is when we need to get multiple values. function getAllCategoryesId ( ) { $db = JFactory : : getDBO ( ) ; $query = "SELECT `category_id` FROM `#__jshopping_categories` WHERE `category_publish` = 1" ; $db - > setQuery ( $query ) ; $categoriesId = $db - > loadObjectList ( ) ; $ids = array ( ) ; foreach ( $categoriesId as $catId ) { array_push ( $ids , $catId - > category_id ) ; } return $ids ; } In this case, we received a list of identifiers of published categories as an array. But there is a situation when we need to get one specific value. For this fit a slightly different design. Also we will wrap everything in a function. function getDescriptionCategory ( ) { ...

Adding fields to the ZOO category

This article is about the ZOO component for Joomla CMS . First of all consider adding a simple text field to the right side of the admin panel category ZOO . 1. Open media/zoo/applications/blog/aplication.xml and after the line < param name = " image " type = " zooimage " label = " Image " description = " Choose a category image. " /> add: < param name = " ourname " type = " text " label = " Our field name " description = " Our tip " /> 2. Output in category template media/zoo/applications/blog/templates/default/category.php <?php echo $this - > category - > getParams ( ) - > get ( 'content.ourname' ) ; ?> ourname is our unique name. You can add a picture field ZOO instead of a text field. Сhange type="text" to type="zooimage". We get src of the picture in the output. Adding fields to the main area of the ZOO category admin panel Wh...