Detail template for News module seemingly not working

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Detail template for News module seemingly not working

Post by wmdvanzyl »

Hi All.

With reference to the news module. I can't seem to use a detail template. It always uses the default template.

This is how i call the module:

Code: Select all

{news detailtemplate="Detail Template" summarytemplate="Summary Template" category="Portfolio" detailpage="about"}
The summary template works perfectly, but when i try to follow the link to the detail page, it uses the default detail template. The URL on the detail page looks like this:

Code: Select all

https://www.mydomain.com/news/8/42/News-Story/d,Detail%20Template
I'm not sure if this is correct, but i'm assuming the d, is supposed to refer to the detail template.

Site details:

Code: Select all


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

Cms Version: 2.1.4

Installed Modules:

    AceEditor2: 1.05
    AdminSearch: 1.0.1
    CGBlog: 1.14
    CGExtensions: 1.53.8
    CGSimpleSmarty: 2.1
    CGSmartImage: 1.21.3
    CMSContentManager: 1.1
    CMSMailer: 6.2.14
    Captcha: 0.5.3
    CustomContent: 1.10
    DesignManager: 1.1.1
    Disqus: 2.1.0
    FileManager: 1.5.2
    FormBuilder: 0.8.1.4
    Forum: 0.9.4
    FrontEndUsers: 1.31.3
    Gallery: 2.1.5
    JQueryTools: 1.3.9
    LISE: 1.2.1.1
    LISEPortfolio: 1.2.1.1
    ListIt2: 1.4.1
    ListIt2Test: 1.4.1
    MenuManager: 1.50.2
    MetaMax: 2.1.5
    MicroTiny: 2.0.3
    ModuleManager: 2.0.2
    Navigator: 1.0.3
    News: 2.50.5
    Printing: 1.1.2
    Search: 1.50.2
    SelfRegistration: 1.6.14
    Showtime2: 3.5.2
    SiteMapMadeSimple: 1.2.8
    ThemeManager: 1.1.8
    TreeManager: 0.6.0


Config Information:

    php_memory_limit:
    max_upload_size: 28000000
    url_rewriting: mod_rewrite
    page_extension:
    query_var: page
    auto_alias_content: true
    locale:
    set_names: true
    timezone: Africa/Johannesburg
    permissive_smarty: true


Php Information:

    phpversion: 5.4.45
    md5_function: On (True)
    json_function: On (True)
    gd_version: 2
    tempnam_function: On (True)
    magic_quotes_runtime: Off (False)
    E_ALL: 24567
    E_STRICT: 2048
    E_DEPRECATED: 0
    test_file_timedifference: No time difference found
    test_db_timedifference: No time difference found
    create_dir_and_file: 1
    memory_limit: 128M
    max_execution_time: 300
    register_globals: Off (False)
    output_buffering: On
    disable_functions:
    open_basedir:
    test_remote_url: Success
    file_uploads: On (True)
    post_max_size: 28M
    upload_max_filesize: 28M
    session_save_path: /tmp (1777)
    session_use_cookies: On (True)
    xml_function: On (True)
    xmlreader_class: On (True)
    check_ini_set: On (True)
    curl: On


Performance Information:

    allow_browser_cache: On (True)
    browser_cache_expiry: 60
    php_opcache: Off (False)
    smarty_cache: Off (False)
    smarty_compilecheck: Off (False)
    smarty_cache_udt: Off (False)
    auto_clear_cache_age: On (True)

Server Information:

    Server Software: Apache
    Server Api: cgi-fcgi
    Server Os: Linux 2.6.32-573.22.1.el6.x86_64 On x86_64
    Server Db Type: MySQL (mysql)
    Server Db Version: 5.5.50
    Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable


Permission Information:

    tmp: /home/modhcbsp/public_html/tmp (0755)
    tmp_cache: /home/modhcbsp/public_html/tmp/cache (0755)
    templates_c: /home/modhcbsp/public_html/tmp/templates_c (0755)
    modules: /home/modhcbsp/public_html/modules (0755)
    uploads: /home/modhcbsp/public_html/uploads (0755)
    File Creation Mask (umask): /home/modhcbsp/public_html/tmp/cache (0755)
    config_file: 0400

----------------------------------------------
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Detail template for News module seemingly not working

Post by Rolf »

Name it DetailTemplate or Detail-Template or something
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Detail template for News module seemingly not working

Post by wmdvanzyl »

Thanks for the reply Rolf. Do you think the spaces is the problem?

EDIT: I changed my news templates to not contain spaces, but same result.

Also, if i misspell the parameter, the page does give me a warning. So it definitely picks up the parameter, but then reverts to default for some reason. It doesn't matter which detail template i choose, same result.

** EDIT: Ok this is intersting. Setting the template i want to use as the default, makes the system use that default, but i got this error:

Code: Select all

Catchable fatal error: Object of class news_article could not be converted to string in /home/modhcbsp/public_html/lib/smarty/sysplugins/smarty_internal_templatebase.php(151) : eval()'d code on line 33
SO the issue is that when setting a default template manually, it doesn't show this error, but instead silently fails and gracefully falls back on default - which is pretty cool. But makes debugging difficult. :P

*** EDIT: Nope, i was wrong. Fixed the template and it shows when set as default, but then doesn't work again when trying to specify it. :/
User avatar
rotezecke
Power Poster
Power Poster
Posts: 411
Joined: Fri Apr 18, 2008 9:34 pm

Re: Detail template for News module seemingly not working

Post by rotezecke »

{news detailtemplate="Detail Template" summarytemplate="Summary Template" category="Portfolio" detailpage="about"}
i am under the impression that you can only use either detailtemplate OR summarytemplate. calling both doesnt make any sense and poor cmsms gets confused? also, from memory, category is only for summary not detailed view?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Detail template for News module seemingly not working

Post by velden »

Just quickly tested and this works for me:

Code: Select all

{news detailtemplate="Custom Detail News" summarytemplate="News Summary Sample" category="General" detailpage="cms_tags"}
Pretty urls enabled.
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Detail template for News module seemingly not working

Post by wmdvanzyl »

rotezecke wrote:i am under the impression that you can only use either detailtemplate OR summarytemplate. calling both doesnt make any sense and poor cmsms gets confused? also, from memory, category is only for summary not detailed view?
Hey hey... who's your "poor cmsms" - CMSMS will kick your butt. :P

NO i think it makes perfect sense. Use this summary template, that detail template, showing only these categories and display the full story on the following page. Should work as is. ;)

---
velden wrote:Just quickly tested and this works for me:

Code: Select all

{news detailtemplate="Custom Detail News" summarytemplate="News Summary Sample" category="General" detailpage="cms_tags"}
Pretty urls enabled.
Thanks Velden. I'm glad to know it works at least. I am also using pretty URLs. I assume we are both on 2.1.4?

What does your URL look like on details page? I am wondering if it might be .htaccess messing up the URL
wmdvanzyl
Forum Members
Forum Members
Posts: 214
Joined: Fri May 06, 2011 12:48 pm

Re: Detail template for News module seemingly not working

Post by wmdvanzyl »

I think my question has now changed to this:

How do i debug something like this? Clearly the code works on other systems, but not here. So where does one start to figure out why your specified detail parameter is not working. I would love to hear how the more experienced developers go about solving problems like this.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Detail template for News module seemingly not working

Post by calguy1000 »

How do i debug something like this? Clearly the code works on other systems, but not here. So where does one start to figure out why your specified detail parameter is not working. I would love to hear how the more experienced developers go about solving problems like this.
I would start with a fresh, virgin installation and carefully, step by step document exactly what you do to reproduce this problem in a text file. You will either find out where you messed up or where there is a deficiency in the code or the documentation.

i.e: Create a new summary template... and just put a heading in it or something. Same with a detail template. adjust your News call in a new page, test that it is working (or not... one step at a time). Then finally configure pretty url's.

Once you know the problem and it's solution you can implement it on your problem site.
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.
Locked

Return to “Modules/Add-Ons”