How can I override the title of a GitLab wiki page? - gitlab

I'm am editing pages in a GitLab project wiki.
If I name a page "first-last", the URL is "project/wikis/first-last" and the page title is rendered in sentence case as "First last". If I name a page "first-(last)", the URL is "project/wikis/first-(last)" and the page title is rendered in sentence case as "First (last)".
I want the URL to be "project/wikis/first-last" and the page title to be "First (last)". Thus, I want to override the page title.
My understanding is that GitLab project wikis run on Gollum. According to the Gollum docs page titles can be overridden with one of two methods:
Enable --h1-title. The first H1-level title on the page will override the page title.
Use the metadata directive. If the first line of the page is <!-- --- title: My page title -->, the given value will override the page title.
I don't have access to option 1. I tried option 2 and nothing happened.
How can I override the title of a GitLab wiki page?

From what I can find, there might not be a way to do it. I haven't tried using that Gollum flag, yet.
The GitLab documentation has this section:
Notes on Gollum
We only use Gollum as a storage abstraction layer, to handle the mapping between wiki page slugs and files in the repository.
When rendering wiki pages, we don’t use Gollum at all and instead go through a custom Banzai pipeline. This adds some wiki-specific markup, such as Gollum’s [[link]] syntax.
Because we do not make use of most of Gollum’s features, we plan to move away from it entirely at some point. See this epic for reference.

Related

Liferay 7.3: How to preconfigure a portlet embedded in a page fragment?

We're using Liferay 7.3 (CE) and are trying to embrace the relatively new feature of "Content Pages" with "Page Fragments". We're able to develop page fragments that already include portlets (named "widgets" in the context of content pages), using the <lfr-widget-WIDGETALIAS> tag. So far, that works.
Now we're trying to prepare page fragments that embed portlets with special portlet configuration applied. For example, we want to prepare a page fragment that just shows an asset publisher portlet configured to list WebContent articles from a pre-defined category. The user should be able to just put that fragment onto the page without having to care about the configuration of the asset publisher portlet.
We did not find any direct way to achieve that -- our first guess that the configuration could be written as attributes or content of the <lfr-widget-...> tag was deterred by a hint in the liferay docs that there are no valid attributes or content to attach to that tag.
Does anybody have an inkling of an idea on how to achieve embedding portlets in page fragments with pre-defined portlet configuration applied? (including out-of-the-box Liferay portlets?)
I figured it out myself.
That one thing that the Fragment Editor does not tell you is that the HTML part of a fragment actually is interpreted as a Freemarker template, with the caveat that only Freemarkers alternative syntax is allowed.
That, in turn, means that Liferays taglibs are available, which means we can use the tag <liferay-portlet:runtime> (ported to freemarker alternative syntax, of course), which does accept a defaultPreferences attribute. Now we can just configure the portlet once, find its portletPreferences XML data in the DB (see table PortletPreferences), remove values we do not want to preconfigure and then just use the resulting preferences XML as a value for the defaultPreferences attribute of the <liferay-portlet:runtime> tag.
Care has to be taken for any IDs (e.g. if you want to preconfigure an AssetCategory filter). Better fetch the corresponding object from the corresponding service and get the ID from that object.
This example provides the HTML part for a page fragment that places an AssetPublisher onto the page, preconfigured to show 12 items (instead of the default 20). (CSS, JS and Configuration of the fragment is the default as given by the Page Fragment editor.)
<div class="fragment-12345">
[#assign assetPublisherPortletPreferences="<portlet-preferences>
<preference>
<name>delta</name>
<value>12</value>
</preference>
</portlet-preferences>" /]
[#liferay_portlet["runtime"]
instanceId="${fragmentEntryLinkNamespace}assets"
portletName="com_liferay_asset_publisher_web_portlet_AssetPublisherPortlet"
defaultPreferences="${assetPublisherPortletPreferences}"
/]
</div>
Thank you for this, #orithena. You saved me a lot of trouble.
Another option, to achieve the same result but with simpler syntax, is to use the built-in freeMarkerPortletPreferences:
[#assign assetPublisherPortletPreferences=freeMarkerPortletPreferences.getPreferences({
"delta": "12",
} /]

Is there additional configuration needed to make the breadcrumbs visible in a Spartacus site?

Is there additional configuration needed to make the breadcrumbs visible in a Spartacus-based site? There is a BreadcrumComponent instance inside the BottomHeaderSlot. If I load the page in the JSP-based site, a breadcrumb like "HOME / Warranty" is displayed for a /warranty page. But when I load the Spartacus-based site, it only shows "HOME". What am I missing? Do I need to edit the CMS controllers or map a breadcrumbBuilder to it?
I'm updating my answer as I misunderstood earlier, sorry for that.
Breadcrumbs are resolved in Spartacus by a specific PageMetaResolver. The content pages are by default resolved by the ContentPageMetaResolver, which you could extend.
The breakpoints resolved for Content pages (like the faq page in the sample data) are only contain a link to the home page. You could customise this by providing a custom implementation for the ContentPageMetaResolver.
--- former answer, no longer relevant ---
The visibility depends on the availability of the BreadcrumbComponent in the CMS structure. You can add this component in a page template or in a specific page.
You'll see this on the demo site, see https://spartacus.c39j2-walkersde1-d4-public.model-t.cc.commerce.ondemand.com/. On the home page there's no notion of the breadcrumb, while on other pages there is. In the sampledata, the BreadcrumbComponent is part of the components of the BottomHeaderSlot.
(For reference) Adding comments from "Krzysztof Platis" in Slack:
Backend breadcrumb builders are not reflected in Spartacus, but you can build the breadcrumbs logic by extending and/or providing new PageMetaResolvers. See docs https://sap.github.io/cloud-commerce-spartacus-storefront-docs/seo-capabilities/#page-meta-resolvers.
There is missing a paragraph about breadcumbs. But as an example. you can see https://github.com/SAP/cloud-commerce-spartacus-storefront/blob/develop/projects/core/src/product/services/category-page-meta.resolver.ts#L125.
See: https://spartacus-storefront.slack.com/archives/CD16V16FR/p1580380905111000
You could, for example, extend the BasePageMegaResolver class and override breadcrumb$ by replacing
this.routingPageMetaResolver?.resolveBreadcrumbs()
with
this.routingPageMetaResolver?.resolveBreadcrumbs({ includeCurrentRoute: true })
This option makes Spartacus include the current page in the Breadcrumbs array.

Link to inner section in Liferay Wiki portlet

In Liferay Wiki Portlet (version 6.2), using "creole" syntax, I can add a link to page simply typing its name inside square brackets like in Wikipedia.
[[New Page]]
How to add a link to a specific section of "New Page"?
In Wikipedia it's simply [[New Page#Section Title]], but in Liferay wiki I tried with same syntax but it re-directs me always a new page.
I see that in "New Page" aside "Section Title" heading is present a # that is a perma-link with the following pattern
mydomain.com/-/wiki/Main/New+Page/maximized#section-New+Page-Section+Title
I tried in many ways but... How to create a link to an inner section?
As far as I know Liferay's Creole does not implement linking to a section. The creole help links to this more complete documentation which also does not mention this as part of their markup.
You might have to extend the syntax on your own or use the full link.

Kentico 9 blog main page, archive page, and tag page

I'm new to Kentico, and have spent hours trying to make the blog work but haven't had any luck. Hope someone could help. I created a new blog by [a] using Pages > New Page > Blog; [b] then applying the Blog page template to it; [c] after that I created 2 sample blog posts. The only thing that works is the individual blog post. Other things don't work:
1- the blog main page --> empty
2- the blog archive page (for July) --> empty
3- tag link --> error message "Page /Blogs/My-blog-1.aspx was not found." Although I know I can change the tag link url, not sure what should be in there.
4 - making "Blog" appears on my nav (that I used CSS List menu web part). For this one, as a workaround, I was thinking about adding a blank "Blog" page and had it redirected to the blog url.
I've read the documentation related to Blog, but couldn't make it to work. Thanks for help!
Some of the out of the box templates are setup in such a way to only work on some of the example site templates which is why you're getting these results.
In the rptAllPosts repeater, set the Path property to ./%, ensure the Page types property is set to cms.blogpost, make sure you have a value in the Transformation property as well.
Should be resolved when you finish #1
You will have to modify the Selected Transformation. If you're using the default transformation, about line 9, way at the end you will need to modify the last parameter from ~/Blogs/my-blog-1.aspx to ~/Blog. This should fix the blog tag link.
Your work-around is very common and I'd stick with it for now.

How to change orchard blog home page list view/summary view

I have Orchard 1.7 setup with blog recipe.
The home screen display a list of blog posts.
I want to override the way the content is displayed in summary view. I could do this for each parts. But my styling is such that I need to wrap title, body, and meta tags with a special div when ever the display type is summary.
The problem is:
After shape tracing I understood that the template used in the home page (summary) is same as the detailed one.
Content.cshtml
For detail view I want to use the default core-> Views/Content.cshtml but for summary I need to supply my own. How can I do this?
OR
How to write a driver/widget to the home page. I know how I can do this for parts/fields/modules but I don't have an idea on how to create a driver for Blog home page.
Whenever I add a widget to the homepage the default blog post list still get displayed.
Just create a file called Content.Summary.cshtml in your theme. This will target all summary views, so if you have more than just blog posts on your site you will probably want to have Content-BlogPost.Summary.cshtml.
I wrote a small blog post on Item templates in Orchard if you are interested... http://arkleseizure.net/what-the-hell-is-an-item-template

Resources