The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
need meta tags per page instead of global - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26) +--- Thread: need meta tags per page instead of global (/showthread.php?tid=765) |
need meta tags per page instead of global - haydentech - 09-22-2017 On my site there are various ways to share content via Facebook, etc. To do this correctly, Facebook needs the og:* meta tags in the page header. In UserSpice, these are provided globally in usersc/includes/head_tags.php. I need these locally, as they will be different for each page depending on the shared content. One way I've come up with is to define a global array before head_tags.php gets pulled in, and reference that global array in head_tags.php to produce them. That will almost certainly work, but it seems like there should be a cleaner way that I'm just not seeing. What is the correct way to set this on a page-by-page basis in UserSpice instead of using static content in head_tags.php? need meta tags per page instead of global - karsen - 09-22-2017 An easier way to deal with per-page meta tags might be to add a new database table to hold your different tags, linked to the pages table (which holds the name of the php file you're viewing). When you load the page, grab the meta tags to echo out. |