- Posts: 17
COMMUNITY FORUM
[SOLVED] user items in columns
- wone
-
Topic Author
- Offline
- New Member
I am trying to display user items in the user page view in tabs. Every tab representing a category. If this is not possible, i would like the items to appear in columns like in a category view.
I don't know what to do to achieve this.
Can someone help me?
Thanks
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
I think you can display them it tabs as well.
Before doing anything, read about template overrides in the tutorials to avoid any problems in the K2 upgrade process.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
with item list primary, secondary and leading.
Thanks
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
The user.php doesn't have the option for Leading, Primary, etc. You will have to write the code by yourself in order to achive this. The easiest way is to choose what list/grid you want to use (1, 2, 3 or 4 columns) and make the appropriate changes in the code.
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
i want to have 3 columns. But how to write this code?
some links please.
Thanks in advance!!!
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
<?php foreach ($this->items as $item): ?>
and replace it with
<?php foreach ($this->items as $countItems=>$item): ?>
Then right above the <?php endforeach; ?> add this line
<?php if (($countItems+1)%3==0) echo '<div class="clr"></div>'; ?>
Then all else will be made through CSS. Add something like this:
.userItemView {float:left;width:33.3333%;}
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
i have added the codes as you told me and for the css i put it here
Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Thank you.
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
Part of the message is hidden for the guests. Please log in or register to see it.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
<div class="userItemView" style="float:left;width:33.3333%;"<?php if(!$item->published || ($item->publish_up != $this->nullDate && $item->publish_up > $this->now) || ($item->publish_down != $this->nullDate && $item->publish_down < $this->now)) echo ' userItemViewUnpublished'; ?><?php echo ($item->featured) ? ' userItemIsFeatured' : ''; ?>">
The style should be added after the class="userItemView" closes.
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
all i have to do now is to resize images to make them fit like this
Part of the message is hidden for the guests. Please log in or register to see it.
any idea? can the text be under the image? the other items are not organized too
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
To change it through the user.php file you need to replace the image block with the following:
<?php if($this->params->get('userItemImage') && !empty($item->imageSmall)): ?>
<!-- Item Image -->
<div class="userItemImageBlock">
<span class="userItemImage">
<a href="<?php echo $item->link; ?>" title="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>">
<img src="<?php echo $item->imageSmall; ?>" alt="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>" style="width:<?php echo $this->params->get('itemImageSmall'); ?>px; height:auto;" />
</a>
</span>
<div class="clr"></div>
</div>
<?php endif; ?>
Please Log in or Create an account to join the conversation.
- wone
-
Topic Author
- Offline
- New Member
- Posts: 17
Thaaaaank you very much!!!
But i have an unanswered question asked in this forum 6 months ago : getk2.org/community/New-to-K2-Ask-here-first/170050-sitecomuser1
can u help me for this? I have tried mijosef but i faced lot of 404 errors and i was obliged to remove it.
Thanks in advanced!!!
Please Log in or Create an account to join the conversation.
- George Nasis
-
- Offline
- Elite Member
- Posts: 214
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Thank you.
Please Log in or Create an account to join the conversation.
- George Nasis
-
- Offline
- Elite Member
- Posts: 214
Part of the message is hidden for the guests. Please log in or register to see it.
Please Log in or Create an account to join the conversation.
- Yiota
-
- Visitor
Please Log in or Create an account to join the conversation.