WordPress.org

Ready to get started?Download WordPress

Forums

WP-Filebase Download Manager
Adding _blank to template (15 posts)

  1. jsollows
    Member
    Posted 2 years ago #

    I want to add "_blank" to the default template for WP-Filebase so I can make PDF's available without people loosing the site. Can anyone tell me or show me where I would add that into the default template?

    http://wordpress.org/extend/plugins/wp-filebase/

  2. mralucas
    Member
    Posted 2 years ago #

    i believe this is you are looking for in the single default file download

    <a href="%file_url%" target="_blank" title="Download %file_display_name%">%file_display_name%</a><br />
    try it i hope i got this right

  3. jsollows
    Member
    Posted 2 years ago #

    Thanks but it didn't change anything. Here is a link to the page if it helps.

    http://www.self-regulation.ca/?page_id=123

    I made this change under WP-Filebase > Settings > Templates and Scripts

  4. mralucas
    Member
    Posted 2 years ago #

    before i re search this more would force download be an option located under WP-Filebase Settings on the download tab "Always force download"

  5. jsollows
    Member
    Posted 2 years ago #

    That's ok but given that all the documents will be PDF we would like to open them in a new window. The change you suggested:

    %file_display_name%

    makes total sense so I'm wondering if I'm making the change in the wrong location?

  6. mralucas
    Member
    Posted 2 years ago #

    upon closer inspection there are two download links the image and the link to the right which did you click on when testing my first post

  7. jsollows
    Member
    Posted 2 years ago #

    I tried changing both of them. It had no effect.

  8. mralucas
    Member
    Posted 2 years ago #

    Got it i tested on my site i created the template just like this and it worked under both links
    Image link
    <div class="wpfilebase-fileicon"><a href="%file_url%" title="Download %file_display_name%"target="_blank"><img align="middle" src="%file_icon_url%" alt="%file_display_name%" /></a></div>

    text link
    <a href="%file_url%" title="Download %file_display_name%"target="_blank">%file_display_name%</a><br />

    both test on my site with a small pdf

  9. jsollows
    Member
    Posted 2 years ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin ]

    I appreciate the try but still no change. Here is the entire template.

    <div class="wpfilebase-attachment">
     <div class="wpfilebase-fileicon"><a href="%file_url%"><img align="middle" src="%file_icon_url%" alt="%file_display_name%" /></a></div>
     <div class="wpfilebase-rightcol">
      <div class="wpfilebase-filetitle">
       <a href="%file_url%">%file_display_name%</a>
       %file_name%
       <!-- IF %file_version% -->%'Version:'% %file_version%<!-- ENDIF -->
       <!-- IF %file_post_id% AND %post_id% != %file_post_id% --><a href="%file_post_url%">%'View post'%</a><!-- ENDIF -->
      </div>
      <div class="wpfilebase-filedetails" id="wpfilebase-filedetails%uid%" style="display: none;">
      <p>%file_description%</p>
      <table border="0">
       <!-- IF %file_languages% --><tr><td><strong>%'Languages'%:</strong></td><td>%file_languages%</td></tr><!-- ENDIF -->
       <!-- IF %file_author% --><tr><td><strong>%'Author'%:</strong></td><td>%file_author%</td></tr><!-- ENDIF -->
       <!-- IF %file_platforms% --><tr><td><strong>%'Platforms'%:</strong></td><td>%file_platforms%</td></tr><!-- ENDIF -->
       <!-- IF %file_requirements% --><tr><td><strong>%'Requirements'%:</strong></td><td>%file_requirements%</td></tr><!-- ENDIF -->
       <!-- IF %file_category% --><tr><td><strong>%'Category:'%</strong></td><td>%file_category%</td></tr><!-- ENDIF -->
       <!-- IF %file_license% --><tr><td><strong>%'License'%:</strong></td><td>%file_license%</td></tr><!-- ENDIF -->
       <tr><td><strong>%'Date'%:</strong></td><td>%file_date%</td></tr>
       <!-- <tr><td><strong>%'MD5 Hash'%:</strong></td><td><small>%file_hash%</small></td></tr> -->
      </table>
      </div>
     </div>
     <div class="wpfilebase-fileinfo">
      %file_size%
      %file_hits% %'Downloads'%
      <a href="#">%'Details'%...</a>
     </div>
     <div style="clear: both;"></div>
    </div>
  10. mralucas
    Member
    Posted 2 years ago #

    Well it works for me here is the url to see it in action
    http://smtv.senshimedia.com/sample-page
    and here is the code i am using

    <div class="wpfilebase-attachment">
     <div class="wpfilebase-fileicon"><a href="%file_url%" title="Download %file_display_name%" target="_blank"><img align="middle" src="%file_icon_url%" alt="%file_display_name%" /></a></div>
     <div class="wpfilebase-rightcol">
      <div class="wpfilebase-filetitle">
       <a href="%file_url%" title="Download %file_display_name%" target="_blank">%file_display_name%</a><br />
       %file_name%<br />
       <!-- IF %file_version% -->%'Version:'% %file_version%<br /><!-- ENDIF -->
       <!-- IF %file_post_id% AND %post_id% != %file_post_id% --><a href="%file_post_url%" class="wpfilebase-postlink">%'View post'%</a><!-- ENDIF -->
      </div>
      <div class="wpfilebase-filedetails" id="wpfilebase-filedetails%uid%" style="display: none;">
      <p>%file_description%</p>
      <table border="0">
       <!-- IF %file_languages% --><tr><td><strong>%'Languages'%:</strong></td><td>%file_languages%</td></tr><!-- ENDIF -->
       <!-- IF %file_author% --><tr><td><strong>%'Author'%:</strong></td><td>%file_author%</td></tr><!-- ENDIF -->
       <!-- IF %file_platforms% --><tr><td><strong>%'Platforms'%:</strong></td><td>%file_platforms%</td></tr><!-- ENDIF -->
       <!-- IF %file_requirements% --><tr><td><strong>%'Requirements'%:</strong></td><td>%file_requirements%</td></tr><!-- ENDIF -->
       <!-- IF %file_category% --><tr><td><strong>%'Category:'%</strong></td><td>%file_category%</td></tr><!-- ENDIF -->
       <!-- IF %file_license% --><tr><td><strong>%'License'%:</strong></td><td>%file_license%</td></tr><!-- ENDIF -->
       <tr><td><strong>%'Date'%:</strong></td><td>%file_date%</td></tr>
       <!-- <tr><td><strong>%'MD5 Hash'%:</strong></td><td><small>%file_hash%</small></td></tr> -->
      </table>
      </div>
     </div>
     <div class="wpfilebase-fileinfo">
      %file_size%<br />
      %file_hits% %'Downloads'%<br />
      <a href="#" onclick="return wpfilebase_filedetails(%uid%);">%'Details'%...</a>
     </div>
     <div style="clear: both;"></div>
    </div>
  11. jsollows
    Member
    Posted 2 years ago #

    Yes that's exactly the same as mine but it definitely doesn't work on my end. Must be a setting somewhere. I'm amazed that this plugin doesn't have this simple capability built in!

  12. mralucas
    Member
    Posted 2 years ago #

    well OK lets start at the beginning the code posted here are not the same take a close look at them, Now i do not if you made changes to them on purpose or if you are unaware of it.

    you do realize that file tree views are created by putting a category template and a single file template together

    the template i changed was manage Template >> Files>> Default

    suggestions:
    1.you reset your templates that if any thing was changed will be fixed
    2. you give me admin admin right use my name here on WP and email me the pass mr_alucas {at} lucashq [dot] com

    3. wait for someone else to come and maybe give better advice than me ( i am always willing to learn something new )
    4. just copy my code above to manage Template >> Files>> Default and cross your fingers

  13. Fabian
    Member
    Plugin Author

    Posted 2 years ago #

    jsollows, you have to alter the "File Browser" Template on Template Management page, File tab.

  14. jsollows
    Member
    Posted 2 years ago #

    That's got it fabifott, thanks for the help!!

  15. lucaweb
    Member
    Posted 1 year ago #

    ... maybe it can be useful to someone: i had the same issue using target="_blank", i solved unchecking "Hide download links" under "Settings> Download" ...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags