The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need meta tags per page instead of global
#1
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?
  Reply
#2
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.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)