Ghost how to add custum template post - ghost

I am building a Ghost blog and for one of my menu pages I want a custom post type.
What I want:
I want to be able to add new posts on one single page: agenda. This post has to have a three fields: image, content and date of event
What I did:
I created a page-agenda.hbs file, I used the default page.hbs. Then I created a post-agenda.hbs using the default.hbs which I customized
Problem
How to refer to my customized post template in the CMS of Ghost. I.e. how to add new posts of type agenda?
Any tips will be helpfull

Ghost doesn't have custom post types. You can tag a post and then make a page that shows those tags using the {{get}} helper but all the posts will still show up in the main index feed. There is a proposed fix for this using channels here: https://github.com/TryGhost/Ghost/wiki/Channels-101

Related

How to insert dynamic content with Django admin interface

I have a simple model for blog posts with a TextField, I save my posts in html format via Django admin interface. But my posts often include hyperlinks to other blog post pages like click here, the number and target of links in a post vary. What is the easy way to insert those urls dynamically in Django admin panel (like template tags used in templates)?
I found an answer, I think this can be done with using builtin url tags like {% url 'blog:posts' 123 %} in my text, saving the text as a template and rendering it again. Either in the view or in the template with a custom template filter.

How do I add a new menu to an aspnetboilerplate based project?

This has been asked before but I'm going to be more precise with my question to hopefully get a better answer:
I have figured out how to add views to the PageNames class:
public const string WorkOrders = "WorkOrders";
and then to the projectNavigationProvider class to get them in to the navbar:
.AddItem(
new MenuItemDefinition(
PageNames.WorkOrders,
L("WorkOrders"),
url: "WorkOrders",
icon: "business",
requiredPermissionName: PermissionNames.Pages_WorkOrders
)
To get my main views added to the main navbar and working properly.
However, I have not figured out how to create a totally new menu to be used elsewhere. In the app I'm working on we have several pages that display all of the records in a particular table, Work Orders for example. But each record in each table should have several links to other pages for create, edit, details and delete.
One of my partners seems to have solved this problem on other pages by using modals and ajax calls to the controllers endpoints. It works fine for the Customers, which only require name and contact info., but I don't think a modal will work for creating, viewing or editing a Work Order becuse it requires adding line items and the associated data for each one of them etc... There's a lot to it. Lastly, it doesn't seem like the template is set up to be used that was as he wrote a lot of his own js to get it working.
Currently, the create, edit, and details views exist and I have links to them next to each record but I get errors when I try to use the link. Maybe I don't understand how the routing works? In the normal mvc template from VS the links have properties for specifying the controller and method and mvc handles the rest.
<a asp-action="Edit" asp-route-id="#item.WorkOrderID">Edit</a> |
<a asp-action="Details" asp-route-id="#item.WorkOrderID">Details</a> |
<a asp-action="Delete" asp-route-id="#item.WorkOrderID">Delete</a>
I'm getting the same error I had when trying to get the Work Orders page to load but had not added it to pagenames or navigationprovider, which makes me thing I just need to add the links to the navigationprovider class but I don't want a link the the WordOrders create page on the main menu, I want it on a mini menu next to the corresponding record. I have added the page to the pagenames class but am not sure how to create a separate menu for my main page.
public const string CreateWorkOrders = "CreateWorkOrders";
In reviewing the navigationprovider class I see:
context.Manager.MainMenu
and I'm thinking I must be able to create another menu and add items to it like this:
context.Manager.NewMenu.AddItem(....
but it looks like MainMenu is referenced in a class that I can't find or edit. Should I be creating another class defining the NewMenu so I would be able to configure it in the existing navigationprovider class or should I be creating a separate navigationprovider class for it?
Hopefully I've convinced everyone who looks at this that I have done plenty of research before reaching out for help. Even a link to some more detailed documentation would helpful.
You can add a new menu like this:
context.Manager.Menus.Add(WorkOrders, new MenuDefinition(WorkOrders, L(WorkOrders)));
Usage:
context.Manager.Menus[WorkOrders].AddItem(...)

How to define the main data post body that's belong to Post page in blogger?

I'm trying to define the real <data:post.body/> that's belong to the post page in Blogger, So I can add the read more script and put the Adsense in the middle of the body, and if you can tell me more about it?! Thanks.
login to your blogger account > Template > Edit Html , now try to find the <data:post.body/> if you are using the simple blogger template you will find 3 of them the first one following to this line <b:includable id='mobile-post' var='post'>about 39 lines between.this data post body belong to the mobile template as it says. Click Enter to go to the other result of search you will find two data post body close from each others the below one is respon to convert the data of your post to shows it as text in your post page the middle one is respon about your post page following to "includable id=post" 34 lines between , If you are using another custom blogger template try to delete every one Separately when you delete two of them and see the result (nothing will happen) the meant data post body will delete your written content in your blog post page , Don't worry when you Undo this transaction the content shows up.
Now we know the main data post body code of your post page , If you add something before this code it will shows up above your content=under post title
if you add something after this code will shows up below your content=end of your post
to add the read more and adsense code in the middle of your post first set up the read more script you will find the data post body splitted to three the followed by quot item quot is the one, replace it to adsense in the middle code.
To clarify: you want a read-more script to run on an ITEM/STATIC-PAGE page type, or do you want the read-more script to run on an INDEX page type? And what do you mean that you're trying to "define" it? data:post.body goes within the post includable.

Creating custom URLs with TYPO3, RealURL and tt_news

Im still not understanding very well how the configuration of RealURL works. So far Im getting my news with this format:
http://www.mysite.com/games/detail/date/2012/01/01/game-1/
But Id like it to be able to customize the URL as I want, like:
http://www.mysite.com/games/WhateverIwanthere/
I have a page with the LIST view (id=3) and a child page with the SINGLE view (id=13)
This is my realurl_autoconf.php: http://pastebin.com/31s9uZDb
Get rid date params from your tt_news links see tt_news docs and find Settings for Links section
Put LIST view and SINGLE view on the same page and switch the views with TypoScript (there are snippets in the net so I don't writ it here)
Use fixedPostVars of RealURL to avoid redundant 'detail' word
With this scenario you'll be able to display:
http://domain.tld/games/ - LIST view
http://domain.tld/games/one-two-three/ - SINGLE view of One Two Three game

How to create permalink pages for individual posts and notes on Tumblr

I'm currently creating my first custom theme for Tumblr and I can't find any explanation of how permalink pages for posts and that post's notes work or how they are written, how do I go about this? what is the code needed and where is it implemented?
Anything you want to appear on a permalink only page you want to have wrapped in block:PermalinkPage tags. If you only want it to show on the index page, wrap it in block:IndexPage tags.
To get your notes to show use {block:PostNotes}{PostNotes}{/block:PostNotes}. This will only appear on a permalink page (despite it not being wrapped in block:PermalinkPage tags. {PostNotes} creates an ol tag with a class of notes for you to style in any way you'd like.

Resources