Custom plugin to append article category to the permalink url

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: April 6, 2016   (RSS)

By adventure - April 5, 2016

I found this post https://www.interactivetools.com/forum/forum-posts.php?postNum=2236916

I created a new folder called permalink_custom and put the code from the above post in that folder as permalink_custom.php

I activated my new plugin, but nothing happens when I save an article post...I am wondering how custom plugins work and exactly how I need to set this up inorder to put the category field from my article table into the permalink url.

thanks,

Jill

jill gerow

By adventure - April 6, 2016

so I got the custom code to fire but now I am getting an error that says

Permalink can only contain these chars (a-z0-9/-.)!

This is the code:

// create custom permalink on first save of record
    if ($tableName == 'newsroom' && !$oldRecord) {
        echo $prefix . @$_REQUEST['category'] .'/'. @$_REQUEST['title'];
        
      $_REQUEST['permalink'] =  $prefix . @$_REQUEST['category'] ."/". @$_REQUEST['title'];
    }

in my testing I add the echo to see what was being passed in and it does not include any bad characters:

news/Video Advertising/Test Permalink Permalink can only contain these chars (a-z0-9/-.)

jill gerow