[solved] Selflink inside News item not evaluated

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
krussell
Forum Members
Forum Members
Posts: 32
Joined: Wed May 16, 2007 2:00 pm

[solved] Selflink inside News item not evaluated

Post by krussell »

When I place a selflink inside the content of a News item, the selflink code is displayed as literal text, rather than being evaluated as a URL within the <a> link tag.

i.e. I get

Code: Select all

<a href="{cms_selflink%20href='foo'}">This is a test</a>
instead of

Code: Select all

<a href="http://mywebsite.com/foo">This is a test</a>
Selflinks work fine for me within regular page content or global content blocks.
Is there any workaround for this, or is it a restriction of the way the News module content is evaluated?
Thanks

-----------------------------------------------------
CMS Install Information
CMS Version 1.10.3

Installed Modules
CMSMailer 2.0.2
CMSPrinting 1.0
FileManager 1.2.0
MenuManager 1.7.7
MicroTiny 1.1.1
ModuleManager 1.5.3
News 2.12.3
Search 1.7
ThemeManager 1.1.4
FormBuilder 0.7.1
Captcha 0.4.5

CMS Config Settings
php_memory_limit 128M
process_whole_template false
output_compression false
max_upload_size 128000000
default_upload_permission 664
url_rewriting mod_rewrite
page_extension /
query_var page
image_manipulation_prog GD
auto_alias_content true
locale
default_encoding utf8_general_ci
admin_encoding utf8_general_ci

PHP Information
Current PHP Version (phpversion) 5.3.8
md5 function (md5_function) On (True)
GD version (gd_version) 2
tempnam function (tempnam_function) On (True)
Magic quotes in runtime (magic_quotes_runtime) Off (False)
Is E_STRICT disabled in error_reporting (E_STRICT)
Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED) E_DEPRECATED is enabled
PHP Effective Memory Limit (memory_limit) 128M
Maximum Execution Time (max_execution_time) 60
PHP output_buffering (output_buffering) 4096
PHP Safe Mode (safe_mode) Off (False)
File uploads (file_uploads) On (True)
Maximum Post Size (post_max_size) 10M
Maximum Upload Size (upload_max_filesize) 128M
Session Save Path (session_save_path) C:\dev\xampp\tmp (0777)
Sessions are allowed to use Cookies (session_use_cookies) On (True)
Basic XML (expat) support (xml_function) On (True)
Checking if the httpd process can create a file inside of a directory it created (create_dir_and_file)
PHP register_globals (register_globals) Off (False)
disable_functions in PHP (disable_functions)
PHP Open Basedir (open_basedir)
Test for remote URL (test_remote_url)
fsockopen: Connection ok!
fopen: Connection ok!
Test ini_set (check_ini_set) On (True)

Server Information
Server API (server_api) apache2handler
Server Database (server_db_type) mysql (mysql)
Server Database Version (server_db_version) 5.5.16
Server Software (server_software) apache/2.2.21 (win32) mod_ssl/2.2.21 openssl/1.0.0e php/5.3.8 mod_perl/2.0.4 perl/v5.10.1
Server Operating System (server_os) winnt 5.1 on i586

Permission Information
tmp C:\dev\xampp\htdocs\esca\tmp (0777)
templates_c C:\dev\xampp\htdocs\esca\tmp\templates_c (0777)
modules C:\dev\xampp\htdocs\esca\modules (0777)
File Creation Mask (umask) C:\dev\xampp\htdocs\esca\tmp\cache (0777)
config_file 0666
config.php writable. It is more safe if you change permission to read-only
Last edited by krussell on Wed Feb 08, 2012 9:04 pm, edited 1 time in total.
uniqu3

Re: Selflink inside News item not evaluated

Post by uniqu3 »

Use {eval var=$entry->content} in your Template.
krussell
Forum Members
Forum Members
Posts: 32
Joined: Wed May 16, 2007 2:00 pm

Re: Selflink inside News item not evaluated

Post by krussell »

Spot on. Thank you very much.
User avatar
wpbremer
Power Poster
Power Poster
Posts: 455
Joined: Thu Nov 13, 2008 12:15 pm

Re: Selflink inside News item not evaluated

Post by wpbremer »

uniqu3 wrote:Use {eval var=$entry->content} in your Template.
Hi I run into the same problem, but where exactly do I place these code and in which Template?

Thanks in advance

Edit: solved it by checking an option in TinyMCE
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 204
Joined: Sun Sep 05, 2010 6:11 am

Re: [solved] Selflink inside News item not evaluated

Post by chrisbt »

Hi wpbremer -
Edit: solved it by checking an option in TinyMCE
Which option solved this in TinyMCE?

Thanks

Chris
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: [solved] Selflink inside News item not evaluated

Post by Dr.CSS »

@wpbremer
That would go in the summary and detail template of news so it can evaluate any smarty code in the content, you would need to do the same thing to the summary call in a template if it has code like that in it...

@chrisbt
Most likely they changed the setting for self link in tiny admin, advanced tab, making it use <a href= instead of {cms_selflink}...
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 204
Joined: Sun Sep 05, 2010 6:11 am

Re: [solved] Selflink inside News item not evaluated

Post by chrisbt »

Thanks @Dr.CSS - makes sense. I think I'll stick with smarty eval as a fix as it feels a more robust solution. Cheers.
Locked

Return to “CMSMS Core”