How can I make that the new pages of a Mediawiki would not be blank/empty? - mediawiki

I'm using a mediawiki in my organisation. All our pages must have the same structure of titles and sections. Since the beginning we create a new page, copy the structure without content from another and then we start to edit the new info.
I would like that when we create a new page, it does not appear as blank or empty, but already have the basic structure of titles.
I don't know even if that is possible.

Mediawiki's manual page creating pages with preloaded text explains how to do this.

I would recommend creating a template and them using the substitution command. The process is as follows..
Create a template page that has the basic layout text that you want to appear on each page. Let's say that page is called "Template:Layout" (since it is a template, it will be in the template namespace).
Once that template as been created, when you go to create a new page, what you do is simple type {{subst:Layout}}. What that does is automatically copy the code from the layout template to the new page.
Now you may wonder why do that, you can just copy and past the code yourself. Well here is why. You can use parameters with substitution as well. Let me create a hypothetical. Say you are creating a new page for each employee at a company. You want each page to say "Hello and welcome to Persons name's page". You can copy and past that on to each new page, OR you could do the following:
Create the Template:Layout with the following text "Hello and welcome to {{{1}}}'s page".
Then when you create a new page for Bob Smith, simply type {{subst:Layout|Bob Smith}} and the text "Hello and welcome to Bob Smith's page" will be inserted at the top of the page.
I would also encourage you to look into the use of templates to stylize your pages. Substitution is similar but it doesn't dynamically change. So if you change the Layout template a week from now, pages where you used {{subst:Layout}} will not change.
Hope that helps.

Related

How to enable "Featured Article" on the main page? Mediawiki

I want to display a random article and a random image once a day on the front page. Like on Wikipedia.
I installed the "FeaturedFeeds" extension, checked if it was enabled, and created the "MediaWiki:Ffeed-*-page", as described in the manual. Replacing "*" with my name. My page is called "MediaWiki:Ffeed-MainFeed-page". However, I don't understand what to do next. The page is empty.
I understand that I need to create some kind of template and put it on the main page, but I don’t understand what exactly to write in the template.
I don't think there's an easy way to do it. Wikipedia's main page features are prepared manually - there is a set of hand-written featured blurbs, like Wikipedia:Today's featured article/November 1, 2022, and a template on the main page selects the one for today's date. See the links here for more information. FeaturedFeeds just generates an RSS feed from the contents of a given page / set of pages.

Adding a specific collection to a specific page in Shopify

When trying to add a collection to a specific page eg. a brand collection on the Gaming page, the collection will appear on all pages. How do I make sure that if I add one collection to a page it only appears on that page. I am using the Dawn Shopify theme.
I have tried changing the theme as indicated by the picture below but I cannot seem to add a new theme except the 'Default page'.
A page in Shopify is a unique resource. That page has specific content you write in it. So if you have a page known as gaming, you are free to write about gaming in that page. You could also include liquid in that page that would render a specific collection. As an example you have a special collection with the handle special-gaming you can include that collection on this page.
You could also create a new template for pages. Call it gaming-page and it is a duplicate of your regular page. But, you edit that liquid, and add in special code to access that special collection. Now, you would just write your page as is, for gaming, but you'd select the new gaming-page template from the online store theme template.
If you experiment with Shopify you'll figure it out. Just play. No better way to learn than to experiment!

Creating a plain html home page AMP with WordPress running the other pages

Gday
I like to know how you would go about creating a home page in plain html and have WordPress run the other pages?
The reason is I’d like to create a solely plain html website but I need WordPress for my contact page it has a large form on it and I use a plugin to generate it and forms are a bit beyond my knowledge at the moment to create a contact page myself.
(I have tried creating a template page but then WordPress adds unnecessary code [from plugins ] and makes the AMP invalid)
Honestly I'd try and keep it self contained in WordPress itself.
If for some reason you really want a separate HTML/PHP Homepage, follow these steps:
Add a my-homepage.php file to your /wp-content/themes/ACTIVE-THEME directory
Inside that file put the following code:
Add a new page (Pages > Add New)
Give it a recognizable name like "My Homepage"
In the "Template" selector on the right hand side, pick "My HTML Homepage" and click Publish
Go to Settings > Reading, change Your homepage displays to A static page and pick the page you just made
Now you can add your own code as you see fit. Nothing "WordPress" related will get loaded or hooked in since there's no functions on that file - so you're free to code HTML (or PHP) to your heart's content.
You can see a bit more indepth answer over on WPSE: https://wordpress.stackexchange.com/questions/296592/how-to-use-custom-html-file-instead-of-wordpress-homepage

squarespace query only for home page

I am using squarespace developer kit and going well. I am wanting to integrate some queries to display some very simple data form my blogs that will appear on my home page ONLY.
Not being very fluent in JSON, I am struggling to implement the query on the home page. I have it set up to display the data from the selected blog but it displays the data through each page.
I only want the data to be visible on the home page at the top. Not in the header but inside where all the content is.
Here is my query that works perfectly well
<squarespace:query collection="feature-articles" limit="10">
<li>
{.repeated section items}
<li>{title}</li>
{.end}
</li>
</squarespace:query>
Can the data be inserted into a code block via the content manager so I can then insert into within the content or am I totally wrong in thinking that.
What I will then do is style/ add or edit the UI of the data into either a carousel or whatever is needed for the project.
I just need to know where to store the query so that it fits in with the content.
Appreciate any time.
Review the following link to see how you can edit a template file, to make different pages use different templates.
http://developers.squarespace.com/template-configuration/
Make a completely custom template just for your homepage then paste you code within your custom .region file as outlin ed in the above guide.
Here is the page about working with template pages:
http://developers.squarespace.com/layouts-regions/
Seeing as you know about , I have a feeling you might already know this, so you might want to be a bit more specific about how your displaying your code and I will gladly update my answer.

Orchard CMS - theming

I have some questions regarding theming Orchard CMS. So, let's begin... I have a website that will have 5 pages and some of them have different layouts.
Pages and zones within it:
Homepage - Content, TripelFirst, TripelSecond, TripelThird
Concept and Rentals page - Content, AsideFirst, AsideSecond
Press and Service Department page - Content, AsideFirst, AsideSecond (different layout then the previous two pages)
Note: Even though all of the pages have the Content zone, except Homepage none of the pages uses it. Other pages only have HTML widgets located in one of the zones.
1) I've read that it is possible to create the layout for the specific ID, the problem is I can't find that ID to create the layout for specific ID.
2) As you can see, couple of pages have the same layout, how to assign them to the specific layout? For example, if I create the layout for Concept and Rentals page how can I assign the specific layout to them and also how can I assign the layout to Press and Service Department pages?
3) How to add the class tag to the body? The problem is that Orchard CMS creates the body before everything else so it isn't contained in the layout cshtml files.
Thank you in advance!
when you edit the page in the admin, the url will look something like http://localhost:30320/OrchardLocal/Admin/Contents/Edit/16
16 is the id here.
Several things you can do. Easiest is to use this module: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector
Alternatively, you could programmatically create alternates based on arbitrary criteria: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Finally, you can often avoid to have to create an actual separate layout by just varying what widgets go where, using layers.
The body tag is in document.cshtml, which you can override in your own theme.
1. Not sure what you mean by ID? If you click Widgets on the DashBoard, there are Layers there. A layer is a collection of widgets that will activate for a specific thing, Like the authenticated Layer will display those widgets you define when a user is authenticated.
Expanding on (1) and for (2), you will be able to create a new layout by adding widgets to a layer.
Check out:
Tagged Layer Rule - Allows you to add widgets based on a tag. Now, you can add pages for concepts and rentals and then specify a layer for these tags, within that layer, you can add any widgets you like. These will only appear when that tag is encountered.
Also check out:
Content Type Layer Rule - Haven't tried this, but it falls on the same lines.
3. To customize the look there is something called Shapes. Each Zone I think has a corresponding cshtml files. You can even use the ShaperBuilder to even render html in code, again, don't know too much about this but I can tell you, you need to look into these articles.
Using shapes as Html helpers in Orchard
Using shapes as Html helpers in Orchard
Taking over list rendering in Orchard
Dispatching Orchard shapes to arbitrary zones
HTH, I'll try and contact some orchard folk that are on SO.
So to help you out here
The ID of the Home Page is always 11 for a fresh install though I imagine that you can delete the home page and create a new one and give it another ID. To find the ID of the other pages open up the DB and look at the Content Items.
I know of no way to apply Layouts other than by ID so just duplicate the layout pages as you have so few pages.
I would just use a small jQuery script
$(document).ready(function{
$('body').addClass('SomeClass');
});