ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Hyperlinked Titles

November 07, 2008 6:39pm

Subscribe [2]
  • #1 / Nov 07, 2008 6:39pm

    pmunnis

    4 posts

    I’d like to be able to allow a user to click on the title of an article and be hyper-linked to display directly a .pdf file or even link to another url address to display a lengthy article.

    I have been trying to figure out how to do this but it eludes me.

    Any ideas, thoughts, suggestions?

    Many thanx
    Paul Munnis

  • #2 / Nov 07, 2008 7:00pm

    lebisol

    2234 posts

    as in aka “read more…” links?
    It is just a link to a new template (eg. ‘read’) where you show the rest of the weblog fields.

    <a href="http://{title_permalink={my_template_group}/read}">Read more…</a>

    If you want to have download fire on visit (onLoad) of that template then you can use some javascript.

    [removed]
    <!--
    function redirect () {
    [removed].href = "{exp:weblog:entries weblog="my_weblog"}{field_fileurl}{/exp:weblog:entries}"
    }
    //-->
    [removed]
    <body>
    
    
    
    
    <div align="center">
        If your download doesn't start automatically then please
    
        <a href="http://{exp:weblog:entries">Download File Manually</a>
    
    
           « <a href="http://www.site.com/index.php/template_grp/">Back to Downloads Section</a>
    </div>
    </body>

    edit note:js code is getting gobbled up.

  • #3 / Nov 07, 2008 7:09pm

    pmunnis

    4 posts

    Many thanx. I’ll give the Javascript approach a shot and see how redirect works for me.

    - Paul

  • #4 / Nov 07, 2008 7:14pm

    lebisol

    2234 posts

    Here is attached image of the JS in case you need it. In essence it is redirect on load of super simple body of the page. The reason I did it this way in case JS fails there is a manual link. Weblog field “field_fileurl”  is used to store full url of the file uploaded.

    Also see test here just hit the download link.
    Hope it works for you.

    p.s. now that I think about it….it doesn’t to be JavaScript….you could use EE’s redirect directly to file…it is only a matter of how you store URL to file in the field of weblog.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases