binary page

Is there a way to edit the binary page? I have a content type File which uses a BnFile template. When I do the inline link to the file it uses that template.

I want to have it so that links to PDFs have the word (PDF) appear next to the link. I can do this using titleLink templates, etc but I can’t see how to edit the BnFile template. Does anyone have any suggestions here?

Shane

I believe that the BnFile template acts like a full page template, thus if you want to link to it (or want to modify the links pointing to it), you would/should be modifying the snippet templates (eg the titlelink snippet etc)…which you seem to know how to do… For us, we modified the title snippet for the particular file content type. This snippet determines what the extension is and what to display (ie pdf icon, file size)…

But how do you handle inline links? When I goto sys_inline_link slot and add File as an allowed content type, it only allows me to choose the bnFile as a template.

Sean,

If you want to control the “Formatting” of the link (e.g. to put PDF icons next to the links) you should use an “Inline Template” rather than an “Inline Link”.

Dave

How does one do that?

You’d create a snippet template with the format you want, and then insert that Inline Template (using the Ephox menu) rather than using the Ephox link icon.

Ok that makes sense, and that can work for me… Except now we run into the issue where if a user highlights the word say “More” or the ever hated “Click here” (yes I’m cringing on this as well) and want to link that do a file, how can i set the template to use that word instead of inserting the title? (if that makes sense).

If you want to use an inline variant template, you could build a “more” snippet that hardcodes the word more instead of the usual display title.

Instead of:
[a href="$pagelink"]
#field(“displaytitle”)
[/a]

Use:
a href="$pagelink"]
More
[/a]

or you could just type More and create a RX Hyperlink to the appropriate item.