Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the <strong>places</strong> page belongs to a custom component (not a Joomla! built-in component), you will need to write or adjust the <strong>router.php</strong> file, in the component's directory.</p> <p>It will need to contain something like:</p> <pre><code>function yourcomponentnameBuildRoute(&amp;$query) { $segments = array(); if (isset($query["x"])) { $segments[] = $query["x"]; unset($query["x"]); } return $segments; } function yourcomponentnameParseRoute($segments) { $vars = array(); $count = count($segments); switch($segments[0]) { case "target": $vars["x"] = "target"; break; } return $vars; } </code></pre> <p><strong>UPDATE for your specific case:</strong></p> <p>Unfortunately there is no way to do this without a core hack.</p> <p>So backup your *components/com_content/router.php* file, and then edit it as follows:</p> <p>Replace the following code (around line 132):</p> <pre><code>if ($view == 'article') { if ($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } $segments[] = $id; } unset($query['id']); unset($query['catid']); </code></pre> <p>with this:</p> <pre><code>if ($view == 'article') { if ($advanced) { list($tmp, $id) = explode(':', $query['id'], 2); } else { $id = $query['id']; } if(isset($query['x']) &amp;&amp; $query['x']) { $segments[] = $query['x']; } $segments[] = $id; } unset($query['x']); unset($query['id']); unset($query['catid']); </code></pre> <p>and this code (around line 212):</p> <pre><code>if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; return $vars; } // if there is only one segment, then it points to either an article or a category // we test it first to see if it is a category. If the id and alias match a category // then we assume it is a category. If they don't we assume it is an article if ($count == 1) { // we check to see if an alias is given. If not, we assume it is an article if (strpos($segments[0], ':') === false) { $vars['view'] = 'article'; $vars['id'] = (int)$segments[0]; return $vars; } </code></pre> <p>with this:</p> <pre><code>if (!isset($item)) { $vars['view'] = $segments[0]; $vars['id'] = $segments[$count - 1]; $vars['x'] = $count &gt;= 2 ? $segments[$count - 2] : NULL; return $vars; } // if there is only one segment, then it points to either an article or a category // we test it first to see if it is a category. If the id and alias match a category // then we assume it is a category. If they don't we assume it is an article if ($count == 1 || ($count == 2 &amp;&amp; (int) $segments[0] === 0)) { // we check to see if an alias is given. If not, we assume it is an article if (strpos($segments[0], ':') === false) { $vars['view'] = 'article'; $vars['x'] = $count == 2 ? $segments[$count - 2] : NULL; $vars['id'] = (int)$segments[$count - 1]; return $vars; } </code></pre> <p>Then in your article's PHP code, you would use:</p> <pre><code>$target = JRequest::getVar("x"); </code></pre> <p>I haven't tested it, so I'm not sure if it works. Let me know.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload