Keyword

Advanced Search

Search Results (Searched for: extra field order)

  • Pietro
  • Pietro's Avatar
05 Jun 2013 13:36
Replied by Pietro on topic Set options with K2

Set options with K2

Category: English K2 Community

Yes, this is what I do.
Now I have tried to empty all K2 tables, and import form Joomla again.

Here following the PARAMS field for Category A in table k2_categories

{"inheritFrom":"0","theme":"","num_leading_items":"2","num_leading_columns":"1","leadingImgSize":"Large","num_primary_items":"4","num_primary_columns":"2","primaryImgSize":"Medium","num_secondary_items":"4","num_secondary_columns":"1","secondaryImgSize":"Small","num_links":"4","num_links_columns":"1","linksImgSize":"XSmall","catCatalogMode":"0","catFeaturedItems":"1","catOrdering":"","catPagination":"2","catPaginationResults":"1","catTitle":"1","catTitleItemCounter":"1","catDescription":"1","catImage":"1","catFeedLink":"1","catFeedIcon":"1","subCategories":"1","subCatColumns":"2","subCatOrdering":"","subCatTitle":"1","subCatTitleItemCounter":"1","subCatDescription":"1","subCatImage":"1","itemImageXS":"","itemImageS":"","itemImageM":"","itemImageL":"","itemImageXL":"","catItemTitle":"0","catItemTitleLinked":"0","catItemFeaturedNotice":"0","catItemAuthor":"1","catItemDateCreated":"1","catItemRating":"0","catItemImage":"1","catItemIntroText":"1","catItemIntroTextWordLimit":"","catItemExtraFields":"0","catItemHits":"0","catItemCategory":"1","catItemTags":"1","catItemAttachments":"0","catItemAttachmentsCounter":"0","catItemVideo":"0","catItemVideoWidth":"","catItemVideoHeight":"","catItemAudioWidth":"","catItemAudioHeight":"","catItemVideoAutoPlay":"0","catItemImageGallery":"0","catItemDateModified":"0","catItemReadMore":"1","catItemCommentsAnchor":"1","catItemK2Plugins":"1","itemDateCreated":"0","itemTitle":"0","itemFeaturedNotice":"1","itemAuthor":"1","itemFontResizer":"1","itemPrintButton":"1","itemEmailButton":"1","itemSocialButton":"1","itemVideoAnchor":"1","itemImageGalleryAnchor":"1","itemCommentsAnchor":"1","itemRating":"1","itemImage":"1","itemImgSize":"Large","itemImageMainCaption":"1","itemImageMainCredits":"1","itemIntroText":"1","itemFullText":"1","itemExtraFields":"1","itemDateModified":"1","itemHits":"1","itemCategory":"1","itemTags":"1","itemAttachments":"1","itemAttachmentsCounter":"1","itemVideo":"1","itemVideoWidth":"","itemVideoHeight":"","itemAudioWidth":"","itemAudioHeight":"","itemVideoAutoPlay":"0","itemVideoCaption":"1","itemVideoCredits":"1","itemImageGallery":"1","itemNavigation":"1","itemComments":"1","itemTwitterButton":"1","itemFacebookButton":"1","itemGooglePlusOneButton":"1","itemAuthorBlock":"1","itemAuthorImage":"1","itemAuthorDescription":"1","itemAuthorURL":"1","itemAuthorEmail":"0","itemAuthorLatest":"1","itemAuthorLatestLimit":"5","itemRelated":"1","itemRelatedLimit":"5","itemRelatedTitle":"1","itemRelatedCategory":"0","itemRelatedImageSize":"0","itemRelatedIntrotext":"0","itemRelatedFulltext":"0","itemRelatedAuthor":"0","itemRelatedMedia":"0","itemRelatedImageGallery":"0","itemK2Plugins":"1","catMetaDesc":"","catMetaKey":"","catMetaRobots":"","catMetaAuthor":""}

My MENU item is type CategoryBlogList, and link to Category A.
Articles are displayed as follows: Title=YES, ... (just like set in Joomla default option for Articles.
And now, if I set Display Title=NO in Joomla default option for Articles, the Title is no more displayed.

Any setting missing? Anything to do in Joomla?
Thank you.
  • David Olsson
  • David Olsson's Avatar
29 May 2013 18:18 - 30 May 2013 09:35
Replied by David Olsson on topic Get intro text to wrap next to the item image

Get intro text to wrap next to the item image

Category: English K2 Community

Hi Kannan,

Sorry to bother you but i have changed following all your steps but can't reach final result...Main image is now to the left so theoretically I should just put intro text after it and it should wrap to right and below main image, right? This is what I think is the intro text in item.php :
/div>
<?php endif; ?>

<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>
<!-- Item introtext -->
<div class="itemIntroText">

I have managed to move it around so it seems like this is the part but wondered if maybe it has to be linked to full text section as I would like it in this order: Main image, intro text wrapped to main image, image galery and then full text. Can it be done?

Thanks in advance. Here is more details of item.php file:

<div class="itemBody">

<!-- Plugins: BeforeDisplayContent -->
<?php echo $this->item->event->BeforeDisplayContent; ?>

<!-- K2 Plugins: K2BeforeDisplayContent -->
<?php echo $this->item->event->K2BeforeDisplayContent; ?>

<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
<!-- Item Image -->
<div class="itemImageBlock">
<span class="itemImage">
<a class="modal" rel="{handler: 'image'}" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>

<?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
<!-- Image caption -->
<span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span>
<?php endif; ?>

<?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
<!-- Image credits -->
<span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span>
<?php endif; ?>
</div>
<?php endif; ?>

<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>
<!-- Item introtext -->
<div class="itemIntroText">
</div>
<?php endif; ?>

<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
<!-- Item image gallery -->
<a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
<div class="itemImageGallery">
<h3><?php echo JText::_(''); ?></h3>
<?php echo $this->item->gallery; ?>
</div>
<?php endif; ?>

<?php if($this->item->params->get('itemNavigation') && !JRequest::getCmd('print') && (isset($this->item->nextLink) || isset($this->item->previousLink))): ?>
<!-- Item navigation -->
<div class="itemNavigation">

<?php echo $this->item->introtext; ?>
</div>
<?php endif; ?>
<?php if($this->item->params->get('itemFullText')): ?>
<!-- Item fulltext -->
<div class="itemFullText">
<?php echo $this->item->fulltext; ?>
</div>
<?php endif; ?>
<?php else: ?>
<!-- Item text -->
<div class="itemFullText">
<?php echo $this->item->introtext; ?>
</div>
<?php endif; ?>

<div class="clr"></div>

<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<!-- Item extra fields -->
<div class="itemExtraFields">
<h3><?php echo JText::_('Main Points'); ?></h3>
<ul>
<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
<?php if($extraField->value != ''): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<?php if($extraField->type == 'header'): ?>
<h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
<?php else: ?>
<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
<?php endif; ?>

<?php if($this->item->params->get('itemHits') || ($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0)): ?>
<div class="itemContentFooter">

<?php if($this->item->params->get('itemHits')): ?>
<!-- Item Hits -->
<span class="itemHits">
<?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?>
</span>
<?php endif; ?>

<?php if($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0): ?>
<!-- Item date modified -->
<span class="itemDateModified">
<?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?>
</span>
<?php endif; ?>

<div class="clr"></div>

Davson
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
27 May 2013 09:54
Replied by Krikor Boghossian on topic Show unpublished items in a module

Show unpublished items in a module

Category: English K2 Community

Hello Jan,

You can have unpublished items in a K2 content module. For the best result you should use an extrafield as your date and manually order them in your module.
  • Bernd Duhnke
  • Bernd Duhnke's Avatar
23 May 2013 12:23
Replied by Bernd Duhnke on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

The best option is, when entering a new option to the dropdown list, the option automatically sorted alphabetically, or from small to large. Or changing it manually in backend like the extra fields.
  • Uldis
  • Uldis's Avatar
14 May 2013 15:20 - 14 May 2013 15:21

[SOLVED] How to show extra fields for related items

Category: English K2 Community

Hello,

I'm really loving new K2 feature <?php echo $this->item->extraFields->EXTRAFIELDALIASHERE->value; ?>

It has helped me a lot in last few projects.

Unfortunately I can't figure out how to use do this for related items in item view.

I added <?php echo $this->item->extraFields->EXTRAFIELDALIASHERE->value; ?> inside foreach loop, but with no success :(

I also noticed that related items use $item instead of $this->item in order to output elements. So I tried using <?php echo $item->extraFields->EXTRAFIELDALIASHERE->value; ?>, but I still couldn't output extra fields.

Could you please help?
  • Theofanis Valmas
  • Theofanis Valmas's Avatar
25 Apr 2013 04:43 - 25 Apr 2013 04:52
Replied by Theofanis Valmas on topic Display specific extra field in module position ?

Display specific extra field in module position ?

Category: English K2 Community

Hello since k2 2.6.2 you can use extra fields as alias but only in item.php in order to use it in MODULE k2 content you should add the following code after the:

<?php foreach ($items as $key=>$item): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; if(count($items)==$key+1) echo ' lastItem'; ?>">

(around line 25 in the mod_k2_content/tmpl/default.php)

<?php
if (!isset($item->extraFields))
{
$item->extraFields = new stdClass;
}
foreach ($item->extra_fields as $extraField)
{
$tmpAlias = $extraField->alias;
$item->extraFields->$tmpAlias = $extraField;
}
?>

now you can type any extra field as this:

$item->extraFields->EXTRA_FIELD_ALIAS->value

or

$item->extraFields->EXTRA_FIELD_ALIAS->name



(the code is from components/com_k2/models/item.php not mine)


this gives you the object to use with alias as you did in item.php

hope it helps!
  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
19 Apr 2013 20:57
Replied by Mohamed Abdelaziz on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

I will add this feature to Multiple Extra Fields for K2 very soon, after the weekend.
  • Micha
  • Micha's Avatar
19 Apr 2013 20:03 - 19 Apr 2013 20:09
Replied by Micha on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

I was looking for a working answer on this one to.
Never find one that really worked.

I started searching for a better way to fix the order of extra fields and found this.

Go to your phpmyadmin or whatever you use for your database. (See image)

1. Click on '????_k2_extra_fields' in the left column.
2. Click one time on the extra field number you want to change in the 'ID' column and start sorting it that way.

Worked out fine for me!

  • Uldis
  • Uldis's Avatar
12 Apr 2013 11:41
Replied by Uldis on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

I'm also very interested in this. If you need to add new value in alphabetic order there is now possibility to do this. Maybe someone found a solution for this?
  • Uldis
  • Uldis's Avatar
10 Apr 2013 16:19

How to display extra fields in category.php

Category: English K2 Community

Thank you both for replying.

Chris, your solution works great on category_item.php or item.php.

But I'm looking for a little bit different solution.

I will try to clarify.

Lets says I have category structure like this:
Fruit
|_Apples (with extra field color)
|_Oranges (with extra field color)

When I enter category Fruit I can display extra fields for each item within item (category_item.php), this is a k2 function.

But I would like to output a list of extra fields outside of item loop (category_item.php). I would like to output extra field values in category.php.

So in my example, at the top of category view I would have unordered list with - green (from apples extra field) and orange (from oranges extra field)
But I would like to output a list
  • Sean Carney
  • Sean Carney's Avatar
08 Apr 2013 19:48

Extra Fields Header Option displays result TWICE

Category: English K2 Community

I am working with Extra fields and have picked the option for Header in order to create a Header that labels the next section of Extra Fields. For some reason I am getting the name of the header displaying twice. I would think it is only supposed to display once?

It is displaying botyh the Label and the Value. But, there actually is NO value. All that should display is the label. Does anybody have a work around for this?

<span class="k2ExtraFieldsLabel">Vitals:</span>
<span class="k2ExtraFieldsValue">Vitals</span>

The page in question is located at:
www.drcarney.com/activities/medical-supervision/mar-2013-at-balcones-springs

you will need to use the following to see it:
login: sitepreview
password: letmeinplease

Anybody that could help me to get my labels to only display the values will be greatly appreciated.

The labels are supposed to be
Vitals
Systolic
Diastolic
Weight
Largest Vitals Changes
Labs
Cholesterol
Triglicerides
Blood Sugar
Largest Lab Results Changes

Thanks.

Sean Carney
PS. If there was a way to make the Header Extra Fields bold that would also be great.
  • Ralf Longwitz
  • Ralf Longwitz's Avatar
02 Apr 2013 14:41
Replied by Ralf Longwitz on topic Sorting K2 items by extra fields

Sorting K2 items by extra fields

Category: English K2 Community

Thanks a lot jayjoo. I did not want to use a module for this. Therefore I used your instructions to change a component file:
\components\com_k2\models\itemlist.php

(I don't know how to do a proper override of this file.)

There I added my order instruction in line 334, overwriting the default ordering (by id):
$orderby = 'i.alias ASC';
  • jeyjoo
  • jeyjoo's Avatar
30 Mar 2013 14:03
Replied by jeyjoo on topic Sorting K2 items by extra fields

Sorting K2 items by extra fields

Category: English K2 Community

Hi guys, if you are still looking for a solution, we worked it out. The solution is an override of the template, but just one line is added.
We have an events section here www.vidalatinaweb.com/it/eventi/congressi-ed-eventi , that has an extra field "date". we wanted to order by this field (this would work with any other extra field you want to order by).

Solution
Create a menu item linking to an empty article.
Create a module k2 contents that selects from your k2 category, that appears on your new empty page
For "Order by", select "Title alphabetical" - we use this as we are going to hack it - so it needs to be an order you will not use for any other module
Open the file modules/mod_k2_content/helper.php
on line 195 find the code

case 'alpha' :
$orderby = 'i.title DESC';
break;

and replace with:

case 'alpha' :
$orderby = 'i.extra_fields DESC';
break;


This will work if you only have one extra field. If you have more than one extra field, you will have to modify the solution, but I think you get the general idea.
  • jeyjoo
  • jeyjoo's Avatar
30 Mar 2013 13:59
Replied by jeyjoo on topic Sort by Extra-Field-Content?

Sort by Extra-Field-Content?

Category: English K2 Community

We just found a way of doing this in k2. The solution is an override of the template, but just one line is added.
We have an events section here www.vidalatinaweb.com/it/eventi/congressi-ed-eventi , that has an extra field "date". we wanted to order by this field (this would work for postcode too).

Solution
Create a menu item linking to an empty article.
Create a module k2 contents that selects from your k2 category, that appears on your new empty page
For "Order by", select "Title alphabetical" - we use this as we are going to hack it - so it needs to be an order you will not use for any other module
Open the file modules/mod_k2_content/helper.php
on line 195 find the code

case 'alpha' :
$orderby = 'i.title DESC';
break;

and replace with:

case 'alpha' :
$orderby = 'i.extra_fields DESC';
break;


This will work if you only have one extra field. If you have more than one extra field, you will have to modify the solution, but I think you get the general idea.

Regards
Jeyjoo
  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
26 Mar 2013 09:19
Replied by Mohamed Abdelaziz on topic Extra Fields more Columns...

Extra Fields more Columns...

Category: English K2 Community

Hello Periklis

Realy, the case you described is a problem, because ordering of mutliselect values is not supported.

But, I think this can be handled by using text fields instead of multiselect fields, and to use a separator like "|" or "," between the values.
And the the template, you will use php explode function to display each value in a separate column.

The multiselect fields scenario allows to use these value as filters or search criteria if this is required, but You can't order them differently for each item.
  • Periklis
  • Periklis's Avatar
25 Mar 2013 20:27
Replied by Periklis on topic Extra Fields more Columns...

Extra Fields more Columns...

Category: English K2 Community

Mohamed,
your guides help me a lot and i have make some progress. But as i work in the way you propose, other problems have been arrived. Just to ask for your opinion, i try to describe what's the problem now.

Let's take an example as before and suppose that we have an extra field, multiselect and three values, 10, 20, 30.

An item has this extra field and its values with this order. 10, 20, 30.
An other item has also this extra field and the same values but with different order. 20, 10, 30.
And so on... But we can stay at this example and take another case that an item has this extra field and the values are 10, 10, 20.

Hmm, i don't know if i successfully explain these two special but not rare situations. What do you think that we can do to bypass these unpleasant situations ?

I attach a screenshot of the multiselect fields.
  • Periklis
  • Periklis's Avatar
19 Mar 2013 21:48
Replied by Periklis on topic More ExtraFields

More ExtraFields

Category: English K2 Community

In order to help, i upload an image that may describe what i want to do
  • Periklis
  • Periklis's Avatar
19 Mar 2013 18:06
Replied by Periklis on topic Extra Fields more Columns...

Extra Fields more Columns...

Category: English K2 Community

That's why i have a headache... :sick:

I am searching the way i can read or write the extrafields in database, two days now. I need an extra column, for example "extrafields2", in order to save the extra column of specifications.
(as i described above, i need two columns of extra fields, for the same item. Not multiple choices and select one of them. I need 3 choices and i need to show all the three values simultaneous)
  • Periklis
  • Periklis's Avatar
19 Mar 2013 16:54
Replied by Periklis on topic Extra Fields more Columns...

Extra Fields more Columns...

Category: English K2 Community

Thank you for your time and patience my friend.

If i have understand you well, you say to enter for example the three values in a multiselect element and at front end to show all three values in the same order side by side.
It's clever enough.

I am trying to figure out a way to save an extra column of extraFields in database but i have difficulties to read the values back from database...
  • Periklis
  • Periklis's Avatar
19 Mar 2013 11:17
More ExtraFields was created by Periklis

More ExtraFields

Category: English K2 Community

Hello,
i have added an extra column in database k2_items called extra_fields2.

Can you give me some main guidelines in order to store and recall from database the data for this extra column ?

In which file the database gets and send the data to the item layout ?

thank you
Displaying 261 - 280 out of 529 results.

Powered by Kunena Forum