I have a taxonomy layout /layouts/talks/taxonomy.html for web pages. I have enabled custom output, calendar and have a /layouts/talks/taxonomy.ics template for ICS files. It is rendered as: /talks/talk-name/index.ics.
Is there a way to rename a slug for the custom output file? I want to name it as event.ics.
This can change defaults:
[outputFormats]
[outputFormats.calendar]
BaseName = "event"
Related
I have set up a next.js markdown blog using mdx: https://mdxjs.com/.
I would like to be able to reference data in the frontmatter section within the mdx file itself. Something like this:
// my-file.mdx
---
title: "My blog post title"
# {title} // should be replaced by the frontmatter title
Now, this does not work. It does NOT replace {title} with the title found in the frontmatter (i.e,. My blog post title). What I am wondering is whether or not there is a way to do this and, if so, how?
Thanks.
Check out the Docusaurus docs page on available exports. For your example, title is available as <p>{contentTitle}</p>. For more specific keys, you can use something like:
<p>{Object.entries(frontMatter).find(frontmatter => frontmatter[0] === 'description'}</p>
to retrieve, in this example, the description. (Replace html <p> tag with whatever tag is appropriate.)
WordPress Repeater link fields: For testing purposes I have defined one link as an Array and the second link as URL. When adding the repeater to a template the output of one link is an Array and the other link is displayed as URL instead of the actual "link text". The link also doesn't open link in new tab as defined.
What's wrong with this setup? See attachments
Working solution to the problem described above:
It is important to know that my issue with ACF and Repeater is related to the Wordpress Oxygen builder.
In order to get get link fields with target blank you need to do the following:
CPT UI > create post type (set has Archive = true)
Custom Fields > Add field type Repeater, add sub-fields = field type set to text
Posts > Add Rows with link custom fields
Create Template > Add repeater to page, add text link module, set data to appropriate Field Name
Define link target: Add JS code block and add the following code
jQuery('a').each(function() {
var a = new RegExp('/' + window.location.host + '/');
if (!a.test(this.href)) {
jQuery(this).attr("target","_blank");
}
});
How can I reference an image, editable in the Wagtail admin, from a CSS file?
I am designing a page type that will have a FooPage.banner_image field. The field is editable for each page, in the Wagtail admin; it describes the image to use for that page, as background on the banner.
The page style for that page then needs to use the banner image, referencing a URL to that specific image. What reference can I write in the CSS, so that it will get “the banner_image for this page” as a URL?
If you are needing an image URL outside of the template - see the docs about Generating renditions in Python.
To get a URL of an image, you need to generate a rendition and then get the URL of that rendition.
A rendition is what is generated when you pass in the resize rules (eg. width-400) in your templates.
To get a URL you can use this example code:
image_url = FooPage.banner_image.get_rendition('fill-300x186').url
OR get the original:
image_url = FooPage.banner_image.get_rendition('original').url
I want to have both Summary and Body in full content view in Drupal 7 but I can't understand how it is possible.
You can edit theme template files to do that. just edit node.tpl.php or page.tpl.php in your theme.
For example get summary in node.tpl.php:
// Load node summary view
$node_view = node_view($node,'summary');
// Get the summary
$summary = $node_view['body'][0]['#markup'];
Or use views to create the content you want.
Status :
I created a page by views module.
name - "Culture and Tradition"
path - "culture-and-tradition"
which to display the "Title" and "Body" of the content by content type.
And I created a block name is "Blk Culture and Tradition" which to display the Title of content by views module.
And then I went to the configuration of structure->block->"Blk Culture and Tradition"
and place the culture-and-tradition into the "Only the listed pages"
Problem : The block "Blk Culture and Tradition" is not display when I went to the views's page of "culture-and-tradition".
How do I display a block while on a page which was created by views
I found the solution from here. And remove marking of content type(s).