Keyword

How to style every single extra field?

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #101041 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: How to style every single extra field?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #101042 by Itay Maor
Replied by Itay Maor on topic Re: How to style every single extra field?
@Michael Lundie or someone else ...
Can you tell me what to add in CSS file?
I tried some version of:
span.itemExtraFieldsValue.status
(status is 1 of the alias extra field i have)

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #101043 by EFFIDOC
Replied by EFFIDOC on topic Re: How to style every single extra field?
hello
i had the same issue and I manage to add the alias of the extrafield in the class property of the li tag

on item.php l 256
<li class="<?php echo ($key%2) ? "odd" : "even"; ?>   type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
change in
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> <?php echo $extraField->alias; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">

then i change the css

Please Log in or Create an account to join the conversation.

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago - 11 years 2 months ago #101044 by theant
Replied by theant on topic Re: How to style every single extra field?
hello Krikor

I changed line 262 to

<span class="itemExtraFieldsValue <?php echo $extraField->alias; ?>"><?php echo $extraField->value; ?></span>

so now I get the right code to style every single extrafield value. Great!
how to if I want to style the label too?

I have a drop-down selection with 4 values (audio, video, text, picture)
If I want to style every value (adding a different icon), how to?
I don't understand your suggestion in other thread:
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<?php if(isset($this->item->extraFields->EXTRAFIELDALIASHERE->value)): ?>
<?php echo $this->item->extraFields->EXTRAFIELDALIASHERE->name; ?>
<?php echo $this->item->extraFields->EXTRAFIELDALIASHERE->value; ?>
<?php endif; ?>
<?php endif; ?>

just replace EXTRAFIELDALIASHERE and add some markup


best regards

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 2 months ago #101045 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: How to style every single extra field?

just replace EXTRAFIELDALIASHERE and add some markup


Every extrafield has an alias (See it's form), you have to insert its alias.

For the label you can use something like
<label class="itemExtraFieldsLabe label<?php echo $extraField->alias; ?>">...

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • theant
  • theant's Avatar Topic Author
  • Offline
  • Premium Member
More
11 years 2 months ago #101046 by theant
Replied by theant on topic Re: How to style every single extra field?
Thanks a lot for reply.

So it is ok with:
<span class="itemExtraFieldsLabel <?php echo $extraField->alias; ?>"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue <?php echo $extraField->alias; ?>"><?php echo $extraField->value; ?></span>


What I really don't undertand is the other thing about the drop-down selection with 4 values styling.

where to insert your code?

and, for my 4 values it shoul be:

<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<?php if(isset($this->item->extraFields->audio->value)): ?>
<?php echo $this->item->extraFields->audio->name; ?>
<?php echo $this->item->extraFields->audio->value; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(isset($this->item->extraFields->video->value)): ?>
<?php echo $this->item->extraFields->video->name; ?>
<?php echo $this->item->extraFields->video->value; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(isset($this->item->extraFields->picture->value)): ?>
<?php echo $this->item->extraFields->picture->name; ?>
<?php echo $this->item->extraFields->picture->value; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(isset($this->item->extraFields->text->value)): ?>
<?php echo $this->item->extraFields->text->name; ?>
<?php echo $this->item->extraFields->text->value; ?>
<?php endif; ?>
<?php endif; ?>

Right?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 2 months ago #101047 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: How to style every single extra field?
Yes it appears correct.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum