Jump to content

table field with "page" field in it?


bernhard
 Share

Recommended Posts

hello,

i really like the profields table and multiplier fields, but what i am missing is a way to achieve this:

   | page             | action      | with sub-pages  | 
---------------------------------------------------------
 # | page-x           | include     | checkbox        |
 # | page-y           | exclude     | checkbox        |
 # | page-z           | include     | checkbox        |
 +

you can do this via repeater field, but i really don't like the UI of repeaters. too much space wasted and not very smart to handle

for example:

i have a widget and want to set the pages where it is visible

site structure:

 - home
   |
   '- cat1
   |  '- sub1
   |  
   '- cat2
   |  '- sub1
   |
   '- cat3

now i have widget-X and want to include it an all pages... this would be:

home | include | with sub-pages

if i had widget-Y and wanted it to show only on cat2 it would be:

cat2 | include | null

if i had widget-Z and wanted it an all pages except cat2 including children

home | include | with sub
cat2 | exclude | with sub

as i said i already achieved it with repeaters:

post-2137-0-46313400-1417564315_thumb.pn

but i need the whole page for only 3 lines!

isn't there a better way?

i would also need this functionality for a sports-club-website: choose player (player is a page unter /players) and then set a position (offense, defense, midfield...) and a number specific to this team

i cant set this values globally because one person can have different positions and numbers in different teams

thanks for your help!

Link to comment
Share on other sites

@BernhardB -

the way that i would attempt to do it (and this is just thinking out loud..) would be to create a page select field on that template, which i would then hide with css, from where to get the page ids and names;

then i would use jquery to grab all of the page names and ids (into a js array) and use that data to create a selector (would probably use chosen) which i would place into all of the fields in the first column; it would need to store the page id in the field value, but then when viewing it, the chosen select would show the label..

Link to comment
Share on other sites

@BernhardB -

actually i think it would be easier to copy all of the necessary options right into the table select field selectable options; I'm doing that now on one site and it works, but you would need to update the selectable options manually...

maybe there is a way to have a module use the api to update the selectable options, for example when a new page under a certain parent is added, this triggers an update of those selectable options...

Link to comment
Share on other sites

yes, that would be an option - but i don't really like the pagetable approach because it opens every item in a new window (lots of clicking and moving your eyes all over) and it stores everything in the pagetree blowing it up... i think i can't choose to store the items under a hidden page (eg admin/players) because i have an unknown number of teams.

what i really don't like with pagetable is that it breaks the logic of the pagetree. if you add your page-table items as children of the current page you will see them in the pagetree. eg.

players   edit | view | new | move

- player 1

- player 2

- player 3

but if you click on "new" beside players and add player 4 it will never show up in the pagetable inside "players" page!

how do you handle this?

thanks for your thoughts

Link to comment
Share on other sites

i think i can't choose to store the items under a hidden page (eg admin/players) because i have an unknown number of teams.

hi reno, thank you for your answer. i think that's still not perfect because as i said i have an unknown number of pages with a pagetable in it. my client (sports club) should be able to manage its teams on its own! eg

team a

 - alex (#6, offense)

 - mike (#10, defense)

 - john (#1, goal)

team b

 - alex (#5, defense)

 - peter (#10, offense)

 - charles (#1, goal)

---> so i would need 2 hidden pages, right? team_a_hidden and team_b_hidden? what if my client wants to setup team c?

Link to comment
Share on other sites

Unless I'm not fully understanding (entirely possible), you can just have them all saved under the same parent. The pageTable field handles the association.

renobird, you are totally right! thank you! i thought i have to have 1 parent page for each table field :)

that's almost perfect together with one-step page adding! even though i would prefer a page field inside profield table, but that question fits better into the profields support board

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...