How to create three step nesting using Hugo? - hugo

I need to create three-step nested Country -> region -> City.
Using static site generator Hugo I know how to create only two-step nested because Hugo have default names for templates (list and single )
see at the folder posts
But I don't know how to create three-step nested.
Thanks, everyone for the help.

Here's one way to accomplish this: For every page under the nested section content/country/region/city, add the front matter param type: nested.
Then create file layouts/nested/single.html with your single template.

Related

SuiteCommerce Advanced - Show a custom record on the PDP

I am looking to create a feature whereby a User can download any available documents related to the item from a tab on the PDP.
So far I have created a custom record called Documentation (customrecord_documentation) containing the following fields:
Related item : custrecord_documentation_related_item
Type : custrecord_documentation_type
Document : custrecord_documentation_document
Description : custrecord_documentation_description
Related Item ID : custrecord_documentation_related_item_id
The functionality works fine on the backend of NetSuite where I can assign documents to an Inventory item. The stumbling block is trying to fetch the data to the front end of the SCA webstore.
Any help on the above would be much appreciated.
I've come at this a number of ways.
One way is to create a Suitelet that returns JSON of the document names and urls. The urls can be the real Netsuite urls or they can be the urls of your suitelet where you set up the suitelet to return the doc when accessed with action=doc&id=_docid_ query params.
Add a target <div id="relatedDocs"></div> to the item_details.tpl
In your ItemDetailsView's init_Plugins add
$.getJSON('app/site/hosting/scriptlet.nl...?action=availabledoc').
then(function(data){
var asHtml = format(data); //however you like
$("#relatedDocs").html(asHtml);
});
You can also go the whole module route. If you created a third party module DocsView then you would add DocsView as a child view to ItemDetailsView.
That's a little more involved so try the option above first to see if it fits your needs. The nice thing is you can just about ignore Backbone with this approach. You can make this a little more portable by using a service.ss instead of the suitelet. You can create your own ssp app for the function so you don't have to deal with SCAs url structure.
It's been a while, but you should be able to access the JSON data from within the related Backbone View class. From there, within the return context, output the value you're wanting to the PDP. Hopefully you're extending the original class and not overwriting / altering the core code :P.
The model associated with the PDP should hold all the JSON data you're looking for. Model.get('...') sort of syntax.
I'd recommend against Suitelets for this, as that's extra execution time, and is a bit slower.
I'm sure you know, but you need to set the documents to be available as public as well.
Hope this helps, thanks.

Get content Id (nid) from path on views block

I just can't seem to wrap my head around Drupal relationships. I have been reading and watching tutorials, but as soon as I try to get my own project done - I fail. I think it's very basic, so I would love to understand it. Maybe someone here can help me understand how it works :)
On my drupal site, I want to keep track of some private game tournaments.
I have created a content type called contestant, which has fields like: Tournament date, Player name, Final Position. I can then create a view that list the information from one tournament. I used the help I got from this thread: drupal views dynamic filter
I would like to have the view described above as a block. And then place that block-view on a "tournament description" page. I could do this, by simply creating a new block each time, and then manually place it on the page it should be shown (structure-->Blocks-->configure), but that is not an elegant way to do it. I am pretty sure this is where Relationships should be used. But I fail to understand how to create this relationship, so that the specific block view, that matches the specific tournament description page will be displayed together.
Use a Content:Nid as a Contextual filter.
WHEN the Filter value is not in the URL >>
Provide default value
Content ID from URL

How can i create a DRUPAL view mixed with nodes and files?

as the title says I'm trying to create a view that displays rendered files and nodes together. Normally when you create a view you have to select what type of content (nodes, taxonomy, files ...) you want do display.
What i want to achieve is a view that displays all nodes and files. The files are NOT mandatory associated with a node. But they are also tagged with terms.
Any idea how to solve that?
Thanks in advance,
Fab
Why don't you create 2 block views and then display it in a page?
For example:
Create a view block that displays the files --> "display_files-block"
Create a view block that displays the nodes--> "display_nodes-block"
and then print them in a static page u create,
For example: "Display files and nodes", with id 1.
inside page--node--1.tpl.php write:
$block = module_invoke('views', 'block_view', 'display_files-block');
print render($block['content']);
$block = module_invoke('views', 'block_view', 'display_nodes-block');
print render($block['content']);
This doesn't answer the question correctly but can be used as a work around for getting data from two entities to appear in one view.
Through the UI, you could create a view called FilesAndNodes, and only add Global:Custom Text Area under the fields section.
Then create another view called Files, and add this view under the Header section of FilesAndNodes view.
And then do the same for nodes.
The Block created by the FilesAndNodes view can then be added to the page, and the content appears as one view.

Pyrocms Getting Values at front end

I am new to pyrocms.
How can I get database values on pages of pyrocms. In website of pyrocms I had created a listing page now I want to display database values from pyro database table.
I got your question, you want to create a listing on your front-end page for some database table values which you want to access through your custom module controller. there are many ways to get these values but the simplest way is to use ajax. you already have Jquery added in pyrocms so you can simply make a call to your controller method in ajax and get your required output as HTML and display it in the div element on your page.
$.ajax({
type:"POST",
url:"admin/your-controller-name/your-method-name",
success:function(html){
$('yourdiv').html(html);
}
})
In your controller create a method which get data from database and print it using echo create some listing table etc what you want.
i think you will get my point. if confuse then get back to me
You need to be more specific as PyroCMS has lots of components and each module (blogs, variables, widgets, file uploads etc.) uses specific tags you insert into the page. You may come across references to 'Lex' - that's the name of the parser used to display them.
Tags documentation
PyroCMS (the Professional edition) also has a feature called "Streams" which allows you to build custom databases and this in turn has it's own series of tags.

How to move content to drupal 7 region?

I have created a region named "footer" in my drupal 7 template.
I have created a content type named "footer-article".
I have created a block called "footer-block".
What I want to do is:
whenever I create an article of "footer-article" content type
I want it to automatically reside in the "footer" region in all of my pages/ or some of the pages?
What is the most efficient and simplest way to do it?
because I was thinking that I always need to create new blocks and put article inside this block in order for me to position it in my desired region?
I am a newbie in drupal 7
Thanks for your help.
Install the views module. Always install the views module.
http://drupal.org/project/views
It will allow you to make a list of a content type, which you can then export as a block and add to your region. This will automatically update the block when ever you add a new "footer-article".
You can set the view to show full posts, teasers or certain fields.
It's the best module for Drupal in my opinion and is a must have for any Drupal sites.

Resources