Pretty urls | The Conference Plugin | Forum

 

Current User: Guest
Login
Members
Please consider registering


Lost Your Password?

Search Forums:

 








Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Pretty urls

Reply to Post
Add a New Topic
No Tags
User Post

6:54 am
December 12, 2011

julienramel

Member

posts 3

Hi,

 

I'm wondering if I'm doing something wrong, or if there is more settings to use pretty url's….

 

For example my program page has the url  (simply in a page named “program-2011″ )

/program-2011

 

all good, but when I click on a speaker name it brings to

/program-2011/?subject=lineup&_year=2011&artist=2

 

is there a way to improve or customize the way it looks ?

 

I specially get rid of “artist” that my clients will not like for this project, guess I can do that by looking for the parameter passed with the plugin…. but indeed I'll prefer a

/program-2011/speakers/2011/the-name-of-the-speaker.html

 

cheers

 

julien

12:23 pm
December 12, 2011

Top Quark

Barrie, ON

Member

posts 305

Post edited 12:24 pm – December 12, 2011 by Top Quark


Hi Julien,

Unfortunately at this time, that’s what the URLs look like.  I don’t have pretty speaker URLs in there.  I’m in early planning stages on version two of this plugin which will actually make the speakers a custom post type.  When that happens, we’ll get the pretty URLs.  I don’t have plans on making pretty URLs before that. 

I know, I hate those too.  The “artist” is remnant code from when this plugin started as a way to manage performers for a music festival. 

The URL is set as a $smarty template variable, so you could at least change it from artist= to speaker=, but then you’d need to do something in add_action(‘init’) to set $_GET['artist'] if $_GET['speaker'] is set.  You could approach it like this:

 

add_filter(‘Smarty_Instance_resource_name’,’my_Smarty_resource_name’,10,2); function my_Smarty_resource_name($resource_name,$args){     $smarty = $args[0]; // a reference to the $smarty object

    $ArtistURL = $smarty->get_template_vars(‘ArtistURL’);

    $ArtistURL = str_replace(‘artist=’,’speaker=’,$ArtistURL);

    $smarty->assign(‘ArtistURL’,$ArtistURL);

    return $resource_name;

}

 

 

You can actually use the above filter to completely hijack a given Smarty template, in which case you could approach creating your own pretty url system.  See http://topquark.com/blog/2011/…..ource_name for some info on that.  But that seems like it might be a lot of work.  I don’t know how much resources you have for this project.

Sorry I don’t have a better answer for you at this point.  Version 2 is still months away.

Tq

No Tags
Reply to Post

Reply to Topic:
Pretty urls




Guest Name (Required):

Guest Email (Required):

Smileys
Confused
Cool
Cry
Embarassed
Frown
Kiss
Laugh
Smile
Surprised
Wink
Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
9 + 5
   



© Simple:Press