How to add Navlinks (or article path) in Mediawiki? - mediawiki

I have installed mediawiki 1.21. I am wondering how you can add navlinks (meaning the path to the page. Not sure if I am using the right work to describe it) at the top similar to the way it is in wikihow website? Below is an image so you know what I am referring to.. I find this to be very useful so users can understand where they are when reading an article.
I have created a custom skin and I have a Navlink DIV at the top where I would to show the path to that page there like: wiki -> xyz Category -> Article Name. I have semantic extension installed. Can this be achieved with that? Or is there another way to do it? How can I add the code directly in my skin.php file so this navlink is generated and listed depending on what page the user is on?

Terminology
This kind of feature is called a breadcrumb.
Has MediaWiki already this kind of feature?
Yes, for subpages.
A subpage is a page intitulated Quux/Foo/Bar in a namespace with the subpage feature enabled. By default, this is the User namespace for example, but not the main one (For example, on Wikipedia projects, we want to be able to use titles like AC/DC).
In this situation, a breadcrumb Quux > Foo will be printed.
This doesn't solve your issue, as you want to use categories, but it allows you if you write your custom code to know there already is some code somewhere doing that :)
Breadcrumbs extensions
Some extensions have been developed to solve this particular issue:
BreadCrumbs2
CategoryBreadcrumb
The first is more exhaustive and gives you more flexibility, the second simpler and so a good starting point to write a custom stuff.

Related

Single page template not trigered on Hugo static generator web site

I have a problem to trigger a custom single page on my posts.
The content is organised like this :
With all my posts into the posts folders (I'm no using an _index.md because this folder is one step behind the /content and is considered as a Section for Hugo)
And my layouts look like this (i'm not using a theme) :
However when i click of one of my post leading to /posts/name-of-post/ URL it renders the layout/default/single.html template. I'm really questioning myself since i saw the Hugo's Lookup Order saying that layout/default/single.html has a lower priority than the layout/section/single.html. Moreover when i delete the default/single.html i got an error saying that no "type" "Page" is implemented. Consequently i'm assuming i'm mistaken on the architecture. Then i saw this page of the official documentation using the exact same architecture than mine. I need your help to figure out what's wrong in my folder and i can give further details if needed. Thanks in advance.

FIWARE Wirecloud: which template files are actually used?

We are customizing a Wirecloud installation to provide our own branding, text and header links. We have created a subtheme to the 'defaulttheme' and are overlaying our own template, images and sccs files to accomplish our customization.
We have managed to change the header image, landing page and a few other bits, but are hampered by the following:
The generated HTML provides no clues as to which template it originated from (we think?)
Documentation here: https://wirecloud.readthedocs.io/en/stable/development/platform/themes/
specifies a number of template files, but not all of the template. For example we cannot find the place where the 'Sign in' button is defined.
The wirecloud javascripts seem to insert random bits of html for what should be boilerplate stuff. For example a 'Powered by wirecloud' icon appears at the bottom of the screen. The 'get more components' button appears out of nowhere and we cannot disable it.
Many of the generated elements do not have an id, so it is difficult to disable or identify them in a sccs file. The 'get more components' button for example is not relevant for us, but we cannot remove it (so far).
Does anyone have a completed custom theme we can look at? Or can someone point out which template files / sccs files are used for branding and overall look-and-feel?
True, currently WireCloud doesn't print any comment not any other clue for detecting from what template the html was generated.
Some parts are not generated using templates, for example, the "Sign in" button. I recommend you to create a ticket in the issue tracker for each thing you want to customise and you don't find how to do it, so we will be able to give you a better answer, and to create a template if needed.
Remember that you have to include a "Powered by WireCloud" to comply with the WireCloud license. In the other hand, the "get more components" button can be removed by editing the wirecloud/workspace/wallet/wallet.html template, by removing the following code:
<s:southcontainer>
<t:addmore/>
</s:southcontainer>
Well, this can also be discussed and documented. We usually don't use ids because those elements are better located using some kind of selector.
Anyway, we are working to improve the documentation about themes ASAP.

PhpStorm - print out methods and variables in class files

I have about 10 classes all in individual files. I have not looked at them for ages. Is there a PhpStorm function that would allow me to list the methods and attributes listed in the individual files?
EDIT: The solution is to highlight all the classes you are interested in and then use the diagram tool. See my answer below.
You can use PHPStorm's Structure View:
Use the Structure pop-up window or the Structure tool window to quickly jump to the desired member of a file in the editor. The Structure views provide quick navigation for all supported file types.
You can also use the Structure tool window (Alt+7). This view is flexibly configurable and useful for many tasks, apart from navigation. However, the File Structure pop-up window is the easiest way for quick navigation.
Source https://www.jetbrains.com/phpstorm/help/navigating-with-structure-views.html
Finally discovered what I was looking for.
Highlight all the classes you are interested in in Project view. Right click Diagrams->Show Diagrams (or Ctrl+Alt+Shift+U).
Arrange diagrams on screen.
Select light colored background (Ctrl Backtick) select 5: Look and Feel (not theme).
Right click on diagram and do a print preview. Select Graph for full size. Click OK and make page adjustments. I printed out my 8 classes on an 11 x 17 sheet and I am in "help-my-bad-memory-heaven". Just what I was looking for.
Hope that was useful.
You can use a PHPDoc for that. Generate API doc of your comment doc and you have a offline reference very useful and like your code.
Otherwise, you can attribute a shortcut for launch or focus on the structure view PHPStorm tools.

Obtaining the URL for a Particular Page in DotNetNuke 7

I have created a page in DNN 7 and added the standard feedback module available at Codeplex to it. Now I want to link to this page using a hyperlink in the middle of another page (not from a menu).
I am able to see the URL for the feedback page via the admin pages and it seems to be consistent. So the obvious way would be to use the HTML module and simply hardcode the URL. But something feels wrong about that. I thought of creating a simple module, encapsulate the hyperlink and surrounding text in a control and use NavigateURL to obtain the URL for the feedback page. Unfortunately, I have not been able to figure out how to do that. I have seen a lot of information about getting the URL for other controls within the same module and even using ModuleID but nothing that would help me implement the code for getting the URL for a particular page at my level of experience.
Sorry about the long intro but I was wondering if it is good practice to hardcode the URL and if not how to programmatically obtain the URL for the feedback page.
TIA
The first argument to NavigateURL is TabId (pages are called tabs in the DNN API). To get the ID of the Feedback tab/page, you'll want to call a method off of the DotNetNuke.Entities.Tabs.TabController class; I'd suggest the static method TabController.GetTabByTabPath(portalId, tabPath, cultureCode), so something like this:
Globals.NavigateURL(TabController.GetTabByTabPath(this.PortalId, "//Feedback", string.Empty))
You're still hard-coding the path to the page here; you could have a setting, which would let you pick the page, but that seems like a bit of overkill for a simple link. The main benefit that you would get by hard-coding the path, but still using NavigateURL is that any changes you make to how URLs are generated (e.g. upgrading to the Advanced URL Provider that comes in DNN 7.1) will happen automatically.
Most folks don't worry much about programatically generating links in HTML content.

Show different Main Pages based on host name in MediaWiki

I have two domains pointing to the same wiki sharing the same database.
I would like it so that with domainA.com the main page is MainPageA and with domainB.com it is MainPageB.
The only way to change the the main page of MediaWiki that I know of is to edit MediaWiki:Mainpage, but that is stored in the MySQL database. Since both wikis are sharing the same database, both main pages get changed too.
The reason that the databases are shared is because all articles apply to both wikis, just that the logo of the wiki etc. is different.
Is there some kind of PHP conditional variable I can set to set the Main Page?
You could do this in wikicode, by making your Main Page source look something like this:
{{#switch:{{SERVERNAME}}
|domainA.com={{:Main Page for domainA.com}}
|domainB.com={{:Main Page for domainB.com}}
|#default=<span class=error>Unrecognized domain {{SERVERNAME}}.</span>
}}
or even just:
{{:Main Page for {{SERVERNAME}}}}
For more information, see Help:Magic words at mediawiki.org. (Note that the first version also requires the ParserFunctions extension.)
Ps. There might be some issues with MediaWiki's parser caching that could cause the wrong Main Page to appear. If so, a quick and dirty workaround would be to install the MagicNoCache extension and add __NOCACHE__ to the Main Page.
Pps. A better solution for cache issues might be to make sure that the different sites have separate cache keys, by adding the following line to your LocalSettings.php:
$wgRenderHashAppend .= "!$wgServer";