I am building a back end for user to create their own landing pages. I would like to have a settings page/form where they can choose general styling.
In the form for the various choices I could have fields with their choices. That seems to be the simple part.
eg
Favicon field "add url in the field"
Button colour field: "add color in the field"
For each landing page they create the landing page would use those styles.
How would I go about this?
Please login or Register to submit your answer
There is a lot to this that is not known. For the favicon for example you could have a place holder coded into the landing page like <code><img src="[field_id_here]"></code>, but it depends on what that means to you. What happens if they load an image with a width of 1200px? Is that too big? Then you have to make that <code><img src="[field_id_here]" style="max-width:50px"></code> or create a class that will handle that and put that into a stylesheet somewhere. That's just the favicon. Similar questions come with each field and how you wish to handle things.
For the favicon example I am more looking on how I can change the site's existing favicon. If there was a shortcode or a little php function I could use to do that it would be ideal. The favicon would be a standard 16x16 pixels and replace th site's favicon for that page. https://www.w3schools.com/html/html_favicon.asp
Like a different favicon per landing page or just the one time for the whole site?
Just per landing page. The site has a different one
Read here:
https://wordpress.stackexchange.com/a/318279
and then that would likely need to grab the value of an entry by entry id with something like this:
FrmProEntriesController::get_field_value_shortcode(array('field_id' => x, 'entry' => $entry_id));