My organization has a sprawling wiki that isn't kept up to date very well. To reduce the danger of new people reading a page and not realizing how outdated it is, I'd like to modify the page header so that instead of
Page Name
at the top, it says something like
Page Name - last modified 5/8/10 by Joe
I see that Trac allows page templates, but if we haven't used those before, is there a 'blank' template I could alter to change all existing pages?
Unless you have changed something, Trac wiki pages should have a "Last Modified" entry in the top right-hand corner of each page. Hovering the mouse over different parts of the text will show you more details, like the user name of the last person to edit the page and a detailed timestamp of when the last edit was made. Is this different from the functionality that you are asking about?
You can put the following in site.html in the templates directory of your project directory:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
py:strip="">
<!--!
This file allows customizing the appearance of the Trac installation.
Add your customizations here and rename the file to site.html. Note that
it will take precedence over a global site.html placed in the directory
specified by [inherit] templates_dir.
More information about site appearance customization can be found here:
http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance
-->
<div py:match="div[#id='wikipage']" py:attrs="select('#*')" once="true">
<h1>Last modified ${format_date(page.time)} by ${authorinfo(page.author)}</h1>
${select('*|text()|comment()')}
</div>
</html>
It doesn't add the last modified info into the title, but displays it before rendering the rest of the page. I don't think you can add it to the title without changing the code of how wiki formatting is rendered.
If you want the last modified date to be more visible, you can use the LastModifiedMacro. I'm fairly sure you could insert it into all existing pages with a simple script that read/writes to wiki table in the database, but I've never done anything like that myself. Take a look at the Database Schema, though keep in mind there may be a better way to do this through the Trac API.
Related
I want to manage internal contextual link building in my articles, but somewhat in a well-managed and easier way. It is a pain to change all the link URLs in a text if we change a URL of a page which is linked to many pages in their content.
You shouldn't need to change them if you used the content picker to select the page you are linking to because it inserts a URL in the format {localLink:####} where ### is the id of the document the link is pointing to.
This is then parsed and replaced with the correct and current URL when the document is rendered, so it is always current and correct.
I was wondering whether exists any dashlet which allows you to explore a site's document library. As far as I know doesn't exist such dashlet out of the box, there only exists the "Site Content" dashlet but it is slightly limited.
I have been searching around and "googling" and I found these useful resources that could be useful as a starting point if I had to create my own:
http://ecmarchitect.com/archives/2012/05/08/1592
http://code.google.com/p/fme-alfresco-extensions/wiki/GalleryPlusDashlet2
Do somebody know more dashlets/resources targeting this issue? Any suggestion?
As a temporary solution, I'm also thinking in the possibility of taking advantage of the "Web View" dashlet, by configuring in it such URL that retrieves the documentlist region/component in the documentlibrary page. For example:, share/page/components/documentlibrary/documentlist or share/page/site/{site}/documentlibrary?region=documentlist. Maybe it is crazy or what I'm saying doesn't make any sense, but it is just an idea.
Another idea that have just came to my mind is the option of creating a custom Surf/Share page which includes the component/webscript that implements the explorer of the document library, specifically the documentlist component. Then configure the "Web View" dashlet giving the URL that points to the custom page created. Would it make sense?
Thanks in advance.
You are going to see a couple of site visualization and navigation dashlets on Alfresco Visualization Tools available on https://github.com/bhagyas/alfresco-visualization-tools. The project is still at it's initial phase, but you will find interesting snippets of code used to retrieve the document library content trees within the dashlets.
The project was presented by me at Alfresco DevCon in Berlin just a week ago to bring interactive navigation and content analytics. If interested, you can find the slides at the lightening talk slides in the DevCon 2012 site at Alfresco.
Cheers! =)
Hi I've done exactly the same, it was not really needed for a Dashlet but for to embed the documentlibrary of a site in an iframe for another site.
So what I did was indeed create a new page template embedded-documentlibrary.
I've copied first the following files and renamed them:
site-data/pages/documentlibrary.xml
site-data/template-instances/documentlibrary.xml
site-webscripts/org/alfresco/documentlibrary.ftl
If you rename file 3 or put it in another folder, you need to check the paths in file 1 & 2.
So to make only the documentlibrary appear instead of everyting I just removed everything in file 3 within the <div id="alf-hd"> tag.
If you remove the tag, the document-tree will also be removed and it gave some javascript errors. This should be fixed in the latest version, but haven't tied that.
So it's extremely easy to create your own page and instead of navigating to site/documentlibrary you just navigate to site/embedded-documentlibrary or your own name you've chosen.
And yes then you'll need to use the web-view Dashlet to show it.
The only thing you need to know is, that the links open within the iframe. So if you use the web-view Dashlet, you need to open the links in a new window.
For my situation I needed an iframe, in your case you could also just let the freemarker from your Dashlet render the components needed.
There is a document-liberary-display dashlet available in the alfresco add-on list which can be used to show all the documents from document-library on site-dashlet.
http://addons.alfresco.com/addons/document-library-display-dashlet
Is there any way to exclude Sitefinity main template i used for all the pages, from searching?
Right now if i search,the search is returning the result with words present in the template menu,even though its not belong to the page.
Now i need to search pages exlceding that template contents.
Thanks in Advance.
The problem here is i have added a menu inside a content block widget in a template.
This template is used throughout the site and when i search for a keyword using the search feature, all the pages of the website are listed in the search result because the keyword is also found in the menu.So i need a solution so that the search result does not include the menu content in the search result.
This is a very high priority. Please help me find a solution at the earliest possible.
Ivan Pelovski recently published a blog post on how you can hide content from the search engine by using custom layout controls. Not specifically what you are asking, but maybe it can help.
Here: http://www.sitefinity.com/blogs/ivanpelovski/posts/12-02-06/hiding_page_content_from_the_search_engine_in_sitefinity_using_layout_widgets.aspx
Try adding a robots.txt metatag like this into the top of the template:
<meta name="robots" content="noindex" />
In more recent versions of Sitefinity you can also uncheck a box at each page level that will prevent the page from being indexed. The column for this setting in the database is sf_page_data (table) .. crawlable (column) in case you want to write a sql script to update several pages at once.
The exclusion of templates from search is mentioned in more detail here:
http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/exclude-page-from-search-index.aspx
Note that this will probably also prevent other search engines (such as google) from indexing that page.
A default Trac installation will display the WikiStart page as its home page. I'd like it to display another page. How do I do that? I was unable to find anything with Google, as any request with "Trac" in it will return links to every opensource project that uses Trac.
If you want to keep the "Welcome to Trac" page, have you considered simply migrating that content to a new page and then editing WikiStart? Trac documentation upgrades leave the WikiStart page unchanged (as documented here), so you aren't making trouble for yourself in that regard.
Are you wanting to display a different wiki page, or a different kind of page? I don't know of a config option for the former, but you can use [trac] default_handler in your trac.ini to make, say, the custom query page be the default page.
Edit: Taking a quick glance over the sources, WikiStart is pretty well hard-coded as the start page for the wiki. So, short of patching Trac, I don't think you can do what you're after.
It seems there's no hope in overriding /wiki URL path to render a wiki page other than WikiStart. That's hardcoded by design (maybe for a very good reason).
On the other hand you can use configuration options in [mainnav] section to override Wiki link in main navigation area and make it point at a custom wiki page e.g.
[mainnav]
wiki.label = Home
wiki.href = /wiki/HomePage
see details in trac:wiki:TracInterfaceCustomization#CustomNavigationEntries
If your Trac installation is behind Apache, then you can use an Apache configuration directive to redirect or rename the "home page" url. For example, look at the "Alias" directive.
My solution to the same problem was to use the [[Include]] macro (http://trac-hacks.org/wiki/IncludeMacro), and have the WikiStart page contain a single include statement.
I wanted a different page name than WikiStart so I could use the page name prefixes to categorize sets of pages, e.g., MyToolNameIntroduction is my start page.
This trac ticket suggests it is not directly possible: http://trac.edgewall.org/ticket/9012
I've generated a website documentation of my project with Sandcastle. This website uses frames so when I click though sites my URL in browser does not change.
I would like to have URL changed in browser when I browse through website documentation generated with Sandcastle. Why? Because I would like to link to concrete subpages of documentation from other parts of my developer environment.
And further more I would like to have this links permanent. So when I generate once again documentation from new version of my project, links will not change so that I will not need to change all links to new.
Is this possible and how to acomplish this?
If you add the code below to the top of SplitScreen.js the browser will "inject" the TOC frame and focus on the content you linked directly to (using the trick Vitaly Shibaev showed).
if (window==top) {
window.location = "/?topic=" + (window.location.pathname.substring(1));
}
This code works it the documentation is placed at the root of your website - if you have it in a sub-folder you need to expand on "/?topic" and remove the sub-folder part from the pathname part.
With this change you can use the "direct links". I also expect people who find you via Google get a better experience (getting the content they searched for AND the TOC bar).
In order to create correct links to specific subpages of documentation you may use similar request: $DOCUMENTATION_ROOT$/Index.aspx?topic=html/$TOPIC_ID$.htm
E.g. http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
instead of http://www.ewoodruff.us/shfbdocs/html/8dcbb69b-7a1a-4049-8e6b-2bf344efbbc9.htm
Vitaliy and mawtex have solved the 'how to link to documentation subpages' part of your question.
The "making links permanent so they do not change when regenerating documentation" part of your questions is solved automatically, since the html file names created are based on a hash of the topic name by default. I.e. If you do not change the part of your code that you are documenting, then it will use the same file name.
You can change the way that html file names are generated, but all given methods are based on the member name or a hash of the topic ID, so links shouldn't break if the code hasn't changed.
See Sandcastle Help File Builder's NamingMethod documentation for more info.