If I want to set a field as a css value.

More
14 years 2 months ago #3445 by despair
i will make a new template, rather than duplicate a default one.

In this case I created a new template named 'profile'.
I copied the blogs' category template and default item templete, then modifiied theme to build a gallery.

I just make a test to add an item in some tag like <ul class="item">,whose position is called "color ".

But finally I want to make other category template named course.

All category items' style can selected from fields selector.
When I creat a new course item ,If i select 'mon' and class1 the tag will like <li class="mon class1">
"mon" will set the category item's positon in the monday row, 'class1' will set the item positon 'top:0px';.

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

More
14 years 2 months ago #3449 by Linuus
hmmm ok.

And the code I added above doesn't do it?

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

More
14 years 2 months ago #3452 by despair
Thanks !
I added it
but it still the same.T_T

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

More
14 years 2 months ago #3455 by Linuus
Hmm.

Do you want each row in the list to have a color?
Then you have to put the code in the <li> tag and not the <ul> tag for starters.

But that doesn't solve the error though.

Can you please copy/paste some more code? Like from a couple of rows before the for loop and a couple of rows after.

EDIT:
Add this before your block as well:
<?php if (isset($this->item->positions)) : ?>

and this after:
<?php endif; ?>

Because if it's empty it might mess the foreach I guess.

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

More
14 years 2 months ago #3457 by despair
It work!
I have find the problem.
<ul class="<?php if (isset($items[$i]->positions)) : ?><?php foreach ($items[$i]->positions as $field) : ?><?php echo $field->display; ?><?php endforeach; ?><?php endif; ?>">

Sorry! I lose <?php if (isset($items[$i]->positions)) : ?> :oops: :oops: :oops: :oops: :oops:

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

More
14 years 2 months ago #3458 by despair

Linuus wrote: Hmm.

Do you want each row in the list to have a color?
Then you have to put the code in the <li> tag and not the <ul> tag for starters.

But that doesn't solve the error though.

Can you please copy/paste some more code? Like from a couple of rows before the for loop and a couple of rows after.

EDIT:
Add this before your block as well:
<?php if (isset($this->item->positions)) : ?>

and this after:
<?php endif; ?>

Because if it's empty it might mess the foreach I guess.


Yes!!!...I'm so stupid..
Thank for your help!!!!! :D :D :D

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.303 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline