Question for permalinks (prefix)

By Jesus - January 20, 2020 - edited: January 20, 2020

Hello and happy new year for everyone,

I know its an old thread but for refence (https://www.interactivetools.com/forum/forum-posts.php?postNum=2235153#post2235153). I'm trying to make an adjustment on this code.

I want to grab the destination from a select box to use it for the permalink structure. 

Example:

Destination (table field name: destino) [Cancun,Mexico,Jamaica]

And I want my url to be: mydomainname.com/destino/post-title/

  // is autopopulate needed?
  $permalinkText   = @$_REQUEST['permalink'];
  $permalinkPrefix = $GLOBALS['schema']['permalink']['defaultValue'];
  if ($tableName == "viajes"){
	$requiredPrefix .= htmlspecialchars(@$_REQUEST['destino']);
}

So I want to be able to grab the field name from destino as the prefix for my permalink url 

Thank you for pointing me to the right direction, I know I'm missing something but I'm cycled here :p

Thanks in advance,

Jesus

By daniel - January 21, 2020

Hi Jesus,

It looks like between that old post and now the variable name has changed from $requiredPrefix to $permalinkPrefix, so to make it match you'd need to change your code to this:

// is autopopulate needed?
$permalinkText   = @$_REQUEST['permalink'];
$permalinkPrefix = $GLOBALS['schema']['permalink']['defaultValue'];
if ($tableName == "viajes"){
  $permalinkPrefix .= htmlspecialchars(@$_REQUEST['destino']);
}

Let me know if that does the trick, or if you have any other issues!

Thanks,

Daniel
Technical Lead
interactivetools.com