Keyword

Advanced Search

Search Results (Searched for: extra field order)

  • Jesse Dundon
  • Jesse Dundon's Avatar
14 Aug 2009 21:41

Tutorial: Adding Googlemaps from k2 extra fields

Category: English K2 Community

Do you want to include google maps in your k2 listings? I noticed a few people requesting it, and since so I dug in and figured it out for myself, I figured I would share it with the community. So here it is. I don't have a demo because the site hasn't been released yet, but this should work just fine for everybody. Also, since we can't add in code to this forum :( i have attached the code as .txt files.

Goal: Automatically output a google map based on extra fields right underneath the item's body text.
Solution: Call the fields manually into the template and plug them into a google maps iframe

Step 1: Create extra fields for address, city, state, and zipcode
Step 2: Create a few sample items with the address info filled out for testing
Step 3: Open up components/com_k2/templates/default/item.php
Step 4: Around line 239, you will find a clearing div directly below the output for the introtext/full text that looks like this (code simplified because this forum won't allow it): div class=clr....
Step 5: Below the clearing div, you need to define the custom variable you will be using to grab the custom fields. Add in the php line from my first attachment. You can actually define that anywhere in the code as long as it is above the next step...
Step 6: Add in the div and google maps code I snagged from some random site and call each of your extra fields into it in the correct place. In this case, the number in square brackets [0] is the first field in the group, [1] is the second, etc. In my case, 0,1,3, and 4 corresponded to address, city, state, and zipcode. You need to adjust these numbers based on the ordering of your extra fields. See second attachment.
Step 7: Test it out to make sure it works. Then, adjust the width and height as needed (they appear twice in the code, once each for the iframe, and once each for the map itself). You can also use some css to adjust the googleMap div that contains the iframe.

Enjoy! My final item.php is attached as a .txt file too, check out lines 240-245.
  • Michael Currey
  • Michael Currey's Avatar
30 Jul 2009 06:11

I've got K2 installed but don't see component parameters when creating menu item

Category: English K2 Community

ok, cool. thanks!

I've been playing around and have figured a few things out. i do have some questions (like how to re-order extra fields) so it will be cool to see how things work out.
  • Adam Rifat
  • Adam Rifat's Avatar
29 Jul 2009 12:41
Why JSON to store extra field information was created by Adam Rifat

Why JSON to store extra field information

Category: English K2 Community

It seems that using JSON to store the extra fields is a little short sighted.

I want to be able to write a module / component that searches through my custom item types and pick out certain rows and use that information to do a webservice call.

However, in order to do this I need to select all items from a particular category, decode the JSON and filter on the results. Then I can use this to send some data off to my webservice.

And what if I want to query the database on the basis of the webservice call to pick out a row based on one of the extra fields? It can't be done with a simple select x,y,z from ....

Is it possible that we can store each extra field in a column on it's own rather than in one JSON field? It seems almost impossible to pull out selected pieces of information from the custom item type this way? It's all or nothing?

I see that the search plugin puts all search terms into a separate column separated bv comma. Can this be extended to put each extra field into a separate column?
  • Jeff Whitmore
  • Jeff Whitmore's Avatar
22 Jul 2009 23:16
Replied by Jeff Whitmore on topic K2 filtering

K2 filtering

Category: English K2 Community

I used phpmyadmin to accomplish this by adding incrementing values to the order field in the jos_k2_extra_fields table.

Of course I can't wait till I can do this from the Joomla K2 backend.....
  • Harald Bendschneider
  • Harald Bendschneider's Avatar
10 Jul 2009 20:45
How to create a new category? was created by Harald Bendschneider

How to create a new category?

Category: English K2 Community

This error appears when I try to create a new category:


tablek2category::store failed - Table 'NAME_OF_THE_DATABASE.jos_k2_categories' doesn't exist SQL=INSERT INTO `jos_k2_categories` ( `id`,`name`,`alias`,`description`,`parent`,`extraFieldsGroup`,`published`,`access`,`ordering`,`params` ) VALUES ( '','1','1','','0','0','0','0','','inheritFrom=0\nnum_leading_items=1\nnum_leading_columns=1\nleadingImgSize=Large\nnum_primary_items=2\nnum_primary_columns=2\nprimaryImgSize=Medium\nnum_secondary_items=4\nnum_secondary_columns=1\nsecondaryImgSize=Small\nnum_links=8\nnum_links_columns=2\nlinksImgSize=XSmall\ncatFeaturedItems=1\ncatOrdering=\ncatPagination=2\ncatPaginationResults=1\ntheme=\ncatTitle=1\ncatTitleItemCounter=1\ncatDescription=1\ncatImage=1\ncatFeedLink=1\ncatChildItems=1\nsubCategories=1\nsubCatColumns=2\nsubCatOrdering=\nsubCatTitle=1\nsubCatTitleItemCounter=1\nsubCatDescription=1\nsubCatImage=1\nitemImageXS=100\nitemImageS=200\nitemImageM=400\nitemImageL=600\nitemImageXL=800\nitemImageDefault=0\ncatItemTitle=1\ncatItemFeaturedNotice=1\ncatItemAuthor=1\ncatItemDateCreated=1\ncatItemRating=1\ncatItemImage=1\ncatItemIntroText=1\ncatItemIntroTextWordLimit=\ncatItemExtraFields=1\ncatItemCategory=1\ncatItemTags=1\ncatItemAttachments=1\ncatItemAttachmentsCounter=1\ncatItemVideo=1\ncatItemImageGallery=1\ncatItemDateModified=1\ncatItemReadMore=1\ncatItemCommentsAnchor=1\ncatItemK2Plugins=1\nitemDateCreated=1\nitemTitle=1\nitemFeaturedNotice=1\nitemAuthor=1\nitemFontResizer=1\nitemPrintButton=1\nitemEmailButton=1\nitemSocialButton=1\nitemVideoAnchor=1\nitemImageGalleryAnchor=1\nitemCommentsAnchor=1\nitemRating=1\nitemImage=1\nitemImgSize=Large\nitemImageMainCaption=1\nitemImageMainCredits=1\nitemIntroText=1\nitemFullText=1\nitemExtraFields=1\nitemHits=1\nitemTwitterLink=1\nitemDateModified=1\nitemAuthorBlock=1\nitemAuthorImage=1\nitemAuthorDescription=1\nitemAuthorURL=1\nitemAuthorEmail=1\nitemAuthorLatest=1\nitemAuthorLatestLimit=5\nitemRelated=1\nitemRelatedLimit=5\nitemCategory=1\nitemTags=1\nitemShareLinks=1\nitemAttachments=1\nitemAttachmentsCounter=1\nitemVideo=1\nitemVideoCaption=1\nitemVideoCredits=1\nitemImageGallery=1\nitemNavigation=1\nitemComments=1\nitemMetaDescription=1\nitemMetaKeywords=1\nitemMetaRobots=1\nitemMetaAuthor=1\nitemK2Plugins=1\n\n' )

When I create a new item I must select a category. But no selection is possible.

I have asked 1&1 if they have PHP5, they told me to rename all php-files of a component in php5. Then they will be handled as PHP5-files...
Is it a bug or can I do something to create a new category?

Thank you!
  • Bryan Smith
  • Bryan Smith's Avatar
10 Jul 2009 17:34
Extra Fields Order was created by Bryan Smith

Extra Fields Order

Category: English K2 Community

How is extra fields ordering controlled?

I see the order tool on the admin panel but all fields are 0 and greyed out.

Is there a way to turn it on and rearrange order?

Thanks
  • Klaus
  • Klaus's Avatar
30 Jun 2009 08:46
Add item and SQL failure was created by Klaus

Add item and SQL failure

Category: English K2 Community

No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND published=1 ORDER BY ordering' at line 1 SQL=SELECT * FROM jos_k2_extra_fields WHERE `group`= AND published=1 ORDER BY ordering
No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT * FROM jos_k2_attachments WHERE itemID=

Its a fresh installation with a Rockettheme template incl the last Rokstories

Can somebody help?

THX

Klaus

I have all plugins installed and publish
  • Klaus
  • Klaus's Avatar
30 Jun 2009 08:46
Add item and SQL failure was created by Klaus

Add item and SQL failure

Category: English K2 Community

No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND published=1 ORDER BY ordering' at line 1 SQL=SELECT * FROM jos_k2_extra_fields WHERE `group`= AND published=1 ORDER BY ordering
No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=SELECT * FROM jos_k2_attachments WHERE itemID=

Its a fresh installation with a Rockettheme template incl the last Rokstories

Can somebody help?

THX

Klaus
  • Carrie Catalano
  • Carrie Catalano's Avatar
30 Jun 2009 00:55
K2 v2 list of bugs was created by Carrie Catalano

K2 v2 list of bugs

Category: English K2 Community

Found a few things wrong,
1 unable to order extra field all say 0
2 upload images fsbozer.com/real-estate.html comes up all scrambled just for some images
3 change images after editing have to checkbox to delete will not upload different photo allways defaults back to first photo
4 add item user, shows all users to add item for even if edit own items only set up
5 add item user allmeta data comes up even if disabled.
6 title of article unlinked
7 front end add item script to large for smaller screens.
Displaying 521 - 529 out of 529 results.

Powered by Kunena Forum