Page 1 of 1

[SOLVED] Modules work in page content but not page template

Posted: Thu Aug 01, 2013 12:32 am
by Simon66
I seem to be the only one having this problem as I can't find any other reference to it in the forums, so I'm assuming it must be my hosting. Any help to understand this is appreciated.

If I put the module tag directly into my template it doesn't work or works a bit but doesn't call a 'detail' template.
If I put the module tag in the page content it works exactly as it should.

This happens with every module I try: News, CGCalendar, ListIt2 etc.

EXAMPLE
So if I put this news module tag in the page content:

Code: Select all

{news inline="1"}
And use this test template, everything works perfectly.

Code: Select all

{content assign="get_content"}<!DOCTYPE html>
<__html>
<head>
<title>Test Page</title>
</head>

</__body>
{$get_content}
<__body>
</__html>
I get a summary list of news articles and the 'MORE' link opens the detail page for that article.

BUT
If I use this template with the News tag built in:

Code: Select all

{content assign="get_content"}<!DOCTYPE html>
<__html>
<head>
<title>Test Page</title>
</head>

</__body>
{news inline="1"}
<__body>
</__html>
I get a summary list of news articles and the 'MORE' link doesn't do anything. The pretty URL changes but the page stays at the summary list.

My System info:
Cms Version: 1.11.7

Installed Modules:

CMSMailer: 5.2.1
CMSPrinting: 1.0.4
FileManager: 1.4.3
MenuManager: 1.8.5
MicroTiny: 1.2.5
ModuleManager: 1.5.5
News: 2.12.12
Search: 1.7.8
ThemeManager: 1.1.8
AceEditor: 0.2.5
CGExtensions: 1.37
CGSimpleSmarty: 1.7
CGSmartImage: 1.11
Captcha: 0.4.6
CustomGS: 1.4
FormBuilder: 0.7.3
GBFilePicker: 1.3.3
SEOTools2: 1.2.1
ListIt2: 1.4
Gallery: 1.6.1
ListIt2XDefs: 1.2
ListIt2frontboxes: 1.4
CGCalendar: 1.10.4


Config Information:

php_memory_limit:
process_whole_template:
max_upload_size: 5000000
url_rewriting: mod_rewrite
page_extension: .htm
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.3.20-pl0-gentoo
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
E_DEPRECATED: 0
memory_limit: 128M
max_execution_time: 30
output_buffering: 4096
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 8M
upload_max_filesize: 5M
session_save_path: No check because OS path
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)


Server Information:

Server Api: cgi-fcgi
Server Db Type: MySQL (mysqli)
Server Db Version: 5.1.62
Server Db Grants: Could not find a suitable "GRANT ALL" permission. This may mean you could have problems installing or removing modules. Or even adding and deleting items, including pages

Simon66

Re: Modules work in page content but not page template

Posted: Thu Aug 01, 2013 12:52 am
by calguy1000
A: The inline param does absolutely nothing (couldn't even find in the source where it was used).

B: What have you set for: Default page to use for detail views (News Module Options Tab).

C: Also, if the URL of the link looks right, but it doesn't cause a refresh and then at least the same page or a 404 coming up I would suspect:
a: javascript errors.
b: htaccess issues

D: Your page template on the detail page needs to have {content} in it somewhere (the assign stuff is fine) or otherwise the article details has nowhere to display.

Re: Modules work in page content but not page template

Posted: Thu Aug 01, 2013 2:53 am
by Simon66
Hi CalGuy,
Thanks for the reply.

Sorry for using News as an example, I was working under the assumption that every module with summary/detail templates had the 'inline' option. My bad.

Although the same thing happens for CGCalendar which does use 'inline'.
So if I put:

Code: Select all

{cms_module module="CGCalendar" inline="1"}
in the page template the 'More' link doesn't replace this (CGCalendar) tag. I still have to set a default page in settings (with a content tag), to display the detail template. Then the return link doesn't work.

But if I put:

Code: Select all

{cms_module module="CGCalendar" inline="1"}
in my page content it works perfectly without a default page set and the return link & pretty URLs work fine.

Simon66

Re: Modules work in page content but not page template

Posted: Thu Aug 01, 2013 3:01 am
by calguy1000
Detail links in CGBlog don't act in inline mode. They do replace the {content} tag of the destination page.

Inline mode will however make the next/prev month links behave inline. So that the link replaces the original tag. This is useful when you have the tag in the sidebar.

I just tested, and checked the code.

Re: Modules work in page content but not page template

Posted: Thu Aug 01, 2013 3:31 am
by Simon66
Thanks CalGuy :)