CMS MADE SIMPLE FORGE

CGBlog

 

[#5738] URL Template field in Options Tab doesn't work correctly

avatar
Created By: Maja Otto (panthus)
Date Submitted: Tue Nov 23 07:48:36 -0500 2010

Assigned To: Robert Campbell (calguy1000)
Version: 1.7
CMSMS Version: None
Severity: Major
Resolution: Fixed
State: Closed
Summary:
URL Template field in Options Tab doesn't work correctly
Detailed Description:
Changes to the URL Template field in the Options Tab don't have any effect.

I solved it by changing line 55 in action.ajax_geturl.php from

$template =
'{$postdate|cms_date_format:\'%Y\'}/{$postdate|cms_date_format:\'%m\'}/{$title}';

to

$template = $this->GetPreference('urltemplate',$template);


History

Comments
avatar
Date: 2011-11-01 02:40
Posted By: Grant O'Neill (gocreative)

I changed that line in the file but it still had no effect for me. Also my URLs
are set to %Y/&m/title, however they only generate 1/title (no year or month,
but the number 1).
      
avatar
Date: 2011-11-12 08:14
Posted By: snarfus (snarfu)

It still does nothing at all. And URL field on entry is not updated if you
change your entry date.
      
avatar
Date: 2011-11-12 10:10
Posted By: snarfus (snarfu)

A fix for this is to change the following things:

action.ajax_geturl.php:
-------------------
55c55
< $template =
'{$postdate|cms_date_format:\'%Y\'}/{$postdate|cms_date_format:\'%m\'}/{$title}';
---
> $template = $this->GetPreference('urltemplate',$template);
-------------------
This gets the preference value for url template not a default hardcoded one

templates/editarticle.tpl
-------------------
37c37
<     $('a.fancybox').fancybox();
---
> //    $('a.fancybox').fancybox();
44c44,45
<         manually_changed = 0
---
>         manually_changed = 0;
>         on_change();
-------------------
First line is just commenting out that fancybox function, as this will lead to
an error which prevents the execution of the defined ajax event handlers.
Second is just convenience as it will refill the url field with the calculated
value if you delete the field.


action.admin_editarticle.php
-------------------
618c618,619
<
---
> $url = $this->CreateURL($id,'ajax_geturl',$returnid);
> $smarty->assign('ajax_get_url',$url);
-------------------
This is needed to make the url functionality available in the edit article
action. Otherwise you get an error and the functionality is disabled.
      
avatar
Date: 2011-12-22 20:02
Posted By: Robert Campbell (calguy1000)

fixed in svn
      
Updates

Updated: 2012-04-06 18:12
state: Open => Closed

Updated: 2011-12-22 20:02
resolution_id: => 7
cmsms_version_id: => -1