[Plugin: WP-Filebase Download Manager] Adding _blank to template
-
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?
-
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 rightThanks but it didn’t change anything. Here is a link to the page if it helps.
https://www.self-regulation.ca/?page_id=123
I made this change under WP-Filebase > Settings > Templates and Scripts
before i re search this more would force download be an option located under WP-Filebase Settings on the download tab “Always force download”
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:
makes total sense so I’m wondering if I’m making the change in the wrong location?
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
I tried changing both of them. It had no effect.
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
[ 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>
Well it works for me here is the url to see it in action
https://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>
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!
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] com3. 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 fingersjsollows, you have to alter the “File Browser” Template on Template Management page, File tab.
That’s got it fabifott, thanks for the help!!
… maybe it can be useful to someone: i had the same issue using target=”_blank”, i solved unchecking “Hide download links” under “Settings> Download” …
- The topic ‘[Plugin: WP-Filebase Download Manager] Adding _blank to template’ is closed to new replies.