Tagged: scope, taxonomy, text field
- This topic has 1 reply, 2 voices, and was last updated 8 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
April 5, 2013 at 10:00 am #749
r.cespaMemberHi, all!
I’m starting to play with Piklist and I’m happy discovering something new every day using the forum, the docs and the source code.
I’m trying to build a travel related web site with offers for holiday packages (flight + hotel + ground services, etc).
I set up a couple of CPTs: hotel and offer; hotels will be related to offers as soon as I figure how to work with relationships. Offer CPT has a couple of custom taxonomies: departure-airport and arrival-airport. Everything is fine here. The idea is that an offer is built on:
one or more hotels
a group field (add_more => true) containing:
departure-airport via text field
arrival-airport via text field
departure-date via date field
several prices (double room, single room, etc) via text fieldsEverything is almost working as expected but if I insert the airport three letters code in one of the text fields with ‘scope’ => ‘taxonomy’ (e.g. FCO for Rome Fiumicino or LHR for London Heathrow) the term is inserted in the taxonomy, the term_id is saved but:
in the taxonomy page there is no CPT associated to the term (so FCO element count is zero)item count is correct if I publish the CPT
in the edit page the term_ID is shown in the text fieldI understand that text field is not the best choice but I want to give the user the ability to add new airports or cities without leaving the page. The idea is to set up some form of autocomplete to help the user and text field is ok for this.
Here is my code: http://pastebin.com/tbHvdPU8
One more problem is due to the fact that as soon as I add more items of the same group of fields (e.g.: one with departure from Rome and one with departure from Milan), I have two text fields in each group. Probably Piklist loops through all the associated terms and prints out one field per term.
Ciao,
Roberto -
April 8, 2013 at 9:45 am #751
SteveKeymaster@r.cespa– I’m not sure I understand the issue, but if you’re having a problem with the count, this code might help: http://piklist.com/support/topic/taxonomies-custom-post-statuses-and-wp_tag_cloud/#post-672
-
-
AuthorPosts
- You must be logged in to reply to this topic.