module_action_link wrong behaviour

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

module_action_link wrong behaviour

Post by nervino »

Hello, I'm trying to edit a CGBlog detail template but the output of the function module_action_link (by CGSimpleSmarty) is not what I expected.

1) The default code at the end of CGBlog detail template:

Code: Select all

{if $prev_id}
<a href="{module_action_link module=CGBlog action=detail articleid=$prev_id}">Previous</a>
{/if}
outputs a wrong link:

Code: Select all

<a index.php?mact="CGBlog,cntnt01,detail,0&cntnt01articleid=&cntnt01returnid=20"" www.mysite.com="" http:="" href="<a href=">CGBlog</a>
2) This alternative code outputs a correct link but a wrong image path (themes/default/images/):

Code: Select all

{if $prev_id}
{module_action_link module='CGBlog' action='detail' articleid=$prev_id text='Previous' image='/images/list_1.png' imageonly=1}
{/if}
it outputs:

Code: Select all

<a href="http://www.mysite.com/index.php?mact=CGBlog,cntnt01,detail,0&cntnt01articleid=1&cntnt01returnid=20">
<img class="systemicon" title="Previous" alt="Previous" src="themes/default/images//images/list_1.png">
</a>
Also, the option "imageonly=1" should be used to display the image only and the text should be used in title attributes. But, if I remove the "imageonly=1", I have:

Code: Select all

<a href="http://www.mysite.com/index.php?mact=CGBlog,cntnt01,detail,0&cntnt01articleid=1&cntnt01returnid=20">
<img class="systemicon" title="Previous" alt="Previous" src="themes/default/images//images/list_1.png">
</a>
<a href="http://www.mysite.com/index.php?mact=CGBlog,cntnt01,detail,0&cntnt01articleid=1&cntnt01returnid=20">Previous</a>
This is the first time I use this function. Is it a bug or my mistake?




----------------------------------------------

Cms Version: 1.11.10

Installed Modules:

CMSMailer: 5.2.2
CMSPrinting: 1.0.5
FileManager: 1.4.4
MenuManager: 1.8.6
MicroTiny: 1.2.6
ModuleManager: 1.5.5
Search: 1.7.11
ThemeManager: 1.1.8
CGExtensions: 1.38.7
CGSmartImage: 1.16.1
JQueryTools: 1.2.6
CGSimpleSmarty: 1.7.2
CGBlog: 1.12.1


Config Information:

php_memory_limit:
process_whole_template:
max_upload_size: 2000000
url_rewriting: none
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale: it_IT.UTF-8
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.3.10-1ubuntu3.8
md5_function: On (Vero)
gd_version: 2
tempnam_function: On (Vero)
magic_quotes_runtime: Off (Falso)
E_STRICT: 0
E_DEPRECATED: 0
memory_limit: 128M
max_execution_time: 30
output_buffering: 4096
safe_mode: Off (Falso)
file_uploads: On (Vero)
post_max_size: 8M
upload_max_filesize: 2M
session_save_path: /var/lib/php5 (1733)
session_use_cookies: On (Vero)
xml_function: On (Vero)
xmlreader_class: On (Vero)


Server Information:

Server Api: apache2handler
Server Db Type: MySQL (mysqli)
Server Db Version: 5.5.32
Server Db Grants: Ho trovato una dichiarazione "GRANT ALL" che sembra essere adatta
Server Time Diff: Nessuna differenza di orario del filesystem individuata


----------------------------------------------
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: module_action_link wrong behaviour

Post by calguy1000 »

A link is not a URL. A link 'contains' a URL.

see the urlonly parameter.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nervino
Power Poster
Power Poster
Posts: 448
Joined: Sun Dec 28, 2008 12:15 pm

Re: module_action_link wrong behaviour

Post by nervino »

Thank yuou, Robert. Using the urlonly parameter solved my problem.

I could had made an incorrect use of "link" instead of "url", nevertheless I wish to know why the default code of the CGBlog detail template generates a wrong link.

Code:

Code: Select all

<a href="{module_action_link module=CGBlog action=detail articleid=$prev_id}">Previous Article</a>
outputs

Code: Select all

CGBlog">Previous Article
(whose url is: 'http://www.example.com/<a href=)

thanks
Last edited by velden on Wed Apr 30, 2014 7:25 pm, edited 1 time in total.
Reason: added apostrophe to fake link so it won't become clickable
Post Reply

Return to “Modules/Add-Ons”