Перейти к содержимому


Фотография
- - - - -

Field Label & Field On Same Line


Лучший Ответ Kess , 05 January 2014 - 13:06

"Separated by" is for repeatable elements as it's description says. You should just make minor modifications to the template files to achieve what you need.

 

First you should open a layout file for your item type. For example, if you are using default "product" type, open the media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product folder. If you want to configure the "teaser" layout then open "teaser.php". Then in that file find where particular position is rendered. For example, this is a code that renders "Properties" position:

<?php if ($this->checkPosition('properties')) : ?>
    <ul>
        <?php echo $this->renderPosition('properties', array('style' => 'list')); ?>
    </ul>
<?php endif; ?>

Notice that there is this code here:

array('style' => 'list')

It means that "list" style should be used for rendering elements in this position. There are a lot of other such styles. You can find them in these folders:

  • media/zoo/applications/jbuniversal/templates/catalog/renderer/element
  • components/com_zoo/renderer/element

 

See the contents of those files and you'll have an idea how they work.

In your case you can use "jbblock" style, it wraps titles in a "strong" tag by default. So in your "teaser.php" just change

array('style' => 'list')

to

array('style' => 'jbblock')

Also it's possible to pass additional parameters here, you can look in the media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product/full.php for some examples. So if you don't like "strong" for labels, try

<?php echo $this->renderPosition('properties', array('style' => 'jbblock', 'labelTag' => 'span')); ?>

Also you can create your own styles by copying existing ones and modifying them.

Перейти к сообщению


  • Закрытая тема Тема закрыта
Сообщений в теме: 2

#1 renee

renee

Отправлено 05 January 2014 - 02:39

I've setup a product catalog and have several text elements that have labels in the 'full' layout. 

 

Having tried all of the 'separate by' styles for the 'product' type for these fields, it seems that the label and the element content default to separate lines.

 

I would like to publish the fields in the 'anons' position (as I don't want to use tabs for this type) but I'd like to have the field content adjacent to the label rather than on the next line.

 

I'd like to have the individual fields seperated by a break.

 

Even the bullet list doesn't have the label adjacent to the field content (except in the teaser layout where the label is adjacent)

 

so I'd like to nkow:

 

1. If there is a configuration I haven't spotted that allows this natively.

2. The easiest template change to make to allow this.

 

Thanks in advance.


  • 0

#2 Kess

Kess

Отправлено 05 January 2014 - 13:06   Лучший Ответ

"Separated by" is for repeatable elements as it's description says. You should just make minor modifications to the template files to achieve what you need.

 

First you should open a layout file for your item type. For example, if you are using default "product" type, open the media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product folder. If you want to configure the "teaser" layout then open "teaser.php". Then in that file find where particular position is rendered. For example, this is a code that renders "Properties" position:

<?php if ($this->checkPosition('properties')) : ?>
    <ul>
        <?php echo $this->renderPosition('properties', array('style' => 'list')); ?>
    </ul>
<?php endif; ?>

Notice that there is this code here:

array('style' => 'list')

It means that "list" style should be used for rendering elements in this position. There are a lot of other such styles. You can find them in these folders:

  • media/zoo/applications/jbuniversal/templates/catalog/renderer/element
  • components/com_zoo/renderer/element

 

See the contents of those files and you'll have an idea how they work.

In your case you can use "jbblock" style, it wraps titles in a "strong" tag by default. So in your "teaser.php" just change

array('style' => 'list')

to

array('style' => 'jbblock')

Also it's possible to pass additional parameters here, you can look in the media/zoo/applications/jbuniversal/templates/catalog/renderer/item/product/full.php for some examples. So if you don't like "strong" for labels, try

<?php echo $this->renderPosition('properties', array('style' => 'jbblock', 'labelTag' => 'span')); ?>

Also you can create your own styles by copying existing ones and modifying them.


Сообщение отредактировал Kess: 05 January 2014 - 13:08

  • 0

#3 renee

renee

Отправлено 08 January 2014 - 16:09

Whilst looking I noticed the meta position has the JBBlock and labelwrap styling natively - so have used that position. But good to know where and how to make the changes. Thanks.


  • 0




Click to return to top of page in style!