Adding file to auto-nav

Permalink
I would like a link to a file to be one of the items in my auto-nav. I added the files URL from the File Manager to the tree of the site map, but I was wondering if this was the best way to do this.

This file will be updated monthly so I wasn't sure if this would be problematic with versions of the file or if this is just a bad way to do this.

Is there a better solution?

Thank you!

 
VPenkov replied on at Permalink Best Answer Reply
VPenkov
If you replace the file instead of uploading a new one, this should be good enough.

Other than that, you can hard-code your file in your autonav template:
$file = File::getByID(FILE_ID);
  $file_version = $file->getApprovedVersion();
  $file_path = $file_version->getRelativePath();


Then you can output the link at the end of your nav by calling
echo $file_path;


If you wanna put it after the Nth link, you can use an iterator (counter). If you really need this, post your autonav template and I'll give you a solution.
benkidder replied on at Permalink Reply
Thanks MoonGrab!

Idealy I would have a live version and a new version that is ready to be published with some other changes to my site.

I was planning on just including it at the end of the nav. Awesome thanks!
VPenkov replied on at Permalink Reply
VPenkov
No biggie.
Please use the "Mark as answer" button so people could locate the answer to your question easier.