Way to store something like a phone number...
Permalink
.. have it repeat on certain pages, and have it be changeable by user through panel?
Kind of like a repeating widget?
Maybe the answer is obvious but it's escaping me today. Thanks.
Kind of like a repeating widget?
Maybe the answer is obvious but it's escaping me today. Thanks.
Hmm, I don't think that's what I'm looking for.
The site I'm building has a contact phone number displayed on most pages. If she were to ever change her phone number, I'd like her to have a relatively simple way of changing it sitewide through the admin panel. Is that possible?
Would making an include, and then creating a block for the include work? Or would that be a really roundabout way of doing it.
The site I'm building has a contact phone number displayed on most pages. If she were to ever change her phone number, I'd like her to have a relatively simple way of changing it sitewide through the admin panel. Is that possible?
Would making an include, and then creating a block for the include work? Or would that be a really roundabout way of doing it.
You want to use the scrapbook and named blocks. Add an html block to a scrapbook called "Embedded Template Items" or something similar that contains the phone number. Rename the block in the scrapbook to be called "Phone Number."
Then, wherever you want the phone number to show up on the page, put this in your theme:
This will pull the block from your scrapbook and put it on the page. If the block is ever deleted or renamed there's an area displayed in edit mode that you could manually add the block to as a fallback.
Then, wherever you want the phone number to show up on the page, put this in your theme:
<?php $block = Block::getByName('Phone Number'); if ($block && $block->bID){ $block->display(); }else { $a = new Area('Phone Number'); $a->setBlockLimit(1); $a->display($c); } ?>
This will pull the block from your scrapbook and put it on the page. If the block is ever deleted or renamed there's an area displayed in edit mode that you could manually add the block to as a fallback.
Yay, this worked perfectly. Thank you!!
Create a new text attribute called "Phone Number" with handle phone_number
Will get the current users phone number.