Welcome to Geeklog, Anonymous Thursday, August 11 2022 @ 11:41 pm EDT

Geeklog Forums

Calling one staticpage from another


Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Unlike stories, staticpages can have if statements, which allows a setup for multilinguality right in the same item (using parameters). However, it causes a problem because there's only one canonical/print/sitemap link.

So I thought of another idea - creating one main staticpage (e.g. foobar) and then minor staticpages (foobar_en, etc.) that do nothing other than setting up the language for the main staticpage.

Alas, staticpages are not actual files, so how can you call them?

For example, my foobar_en is
Text Formatted Code
$lang = "en"; // the main foobar uses that to choose a language
echo what_do_i_put_here(PLG_replaceTags("[staticpage_content:foobar]"));


I tried using "eval" for what_do_i_put_here, but nothing happened.

This works but just returns finished text (that doesn't take the new $lang into account):
Text Formatted Code
$lang = "en"; // the main foobar uses that to choose a language
echo PLG_replaceTags("[staticpage_content:foobar]"); // ignores the new $lang


So do you know how to call/include/require one staticpage from another?
 Quote

All times are EDT. The time is now 11:41 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content