Jump to content

Dynamic Input Field visible on page edit only?


Recommended Posts

I have a dropdown selector for a particular template/page type that allows me to select associated pages - in this case herbal ingredients.  So on the page:

https://theory.yinyanghouse.com/theory/herbalmedicine/tcm-formulas/shen-bu-xin-wan-calm-shen-and-supplement-heart-pills , for example, at the bottom you see "this formula has 8 ingredients" and then below that it links to all of those pages.  This is created by going through the array

$relherbs = $page->fherb_ingredients;

What I would like is a field than when I edit the page that is dynamically created with some data from that array.  Ultimately I would use this to cut and paste into another site for some related links.  So a field that takes what I've selected in my dropdown list and does something like:

show in field when editing

go through the $relherbs array and show:

$myherbs .= '<li><a href="' . $relherb->iherb_functional_grouping->url . '">' . $relherb->iherb_functional_grouping->title . '</a></li>';



I don't need or even want this field to be saved into the database, just shown in a field on the edit page.  I could technically also do this by having it shown only to admins on the page itself - either way is fine.  That seems like it would unnecessarily slow down page loads for no good reason though.

This page 

 seems close, but it's not quite what I want, particularly since I don't want it actually saved.  

Thanks for any help.


Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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