View Full Version : Custom Fields If Statements Question
tfw2005
09-13-2007, 04:05 PM
I have about 70 Custom fields. I am custom coding these into the show entry pages, and removing the default "show above/below" call.
Almost all of them will have <if condition="$entry[fieldX]">Show content my way: $entry[fieldX]</if>. Basically just "if anything is entered, show the HTML".
1. - Will that affect performance if this is accessed heavily.
2. - Is there a better way, type of call, etc.
Brian
09-14-2007, 01:58 PM
1). A little, but it shouldn't be significant at all.
2). Are the majority of the custom fields going to be in set locations? Ex: Fields 1-20 are going to be listed on the right side, 21-40 on the left, and 41-70 in some other random single location. If so, I might recommend modifying the select box where you can choose the Above/Below Message settings to add some custom settings/locations. Then you could use the same $customfieldbits[location] variable in the 'ADV_DYNA_SHOWENTRY' template where you want those fields to be displayed instead of having to add all of the <if conditions> manually.
tfw2005
09-14-2007, 06:27 PM
Hey Brian,
They are going to be in set locations, but lots of specific ones. Plus, I do not want them showing in table format, and I do not want them showing the title of the custom filed in some, but not all, locations. On top of that, I am using AJAX tabbed content to display all this, tho I think your method would work with that too if not for the other things.
Id love to give you a spin on what Ive done, I think it's the most robust usage compared to what Ive seen so far, but its not live. If you have time, PM me and Ill set you up with an admin account so you can poke around.
Later!
Brian
09-15-2007, 01:00 PM
They are going to be in set locations, but lots of specific ones. Plus, I do not want them showing in table format, and I do not want them showing the title of the custom filed in some, but not all, locations. On top of that, I am using AJAX tabbed content to display all this, tho I think your method would work with that too if not for the other things.
Ahhh... You could still possibly change the template that's used for each location so that you could use a set template/style for each one. I don't think it would make much difference, but might be a little "cleaner" than 70 <if condition>'s and slightly easier to manage in the future if you decide to make any changes since you would only have to change one template instead of a few dozen bits of code.
Id love to give you a spin on what Ive done, I think it's the most robust usage compared to what Ive seen so far, but its not live. If you have time, PM me and Ill set you up with an admin account so you can poke around.
I always like to see what ideas everyone is coming up with for our products, so if you'd like to PM me the info I'd love to take a look. :)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.