I need to display all resources' ids as page content, so I used:
[[!getResources? &parents=`0` &tpl=`myTpl`]]
and in myTpl chunk: [[*id]],
But it only displays the current resource's id five times like this:
63, 63, 63, 63, 63,
5 is the number of published resources I have in my tree. I guess my chunk is wrong. The question is how to display all resources' ids on the page?
Change [[*id]] to [[+id]].
[[*id]], [[*pagetitle]], etc. are placeholders for the current resource.
Related
I'm new to Drupal and having a difficult time figuring out the file structure that I need to render my content correctly.
Here's what I have:
A content type called resource_library - with several resource items uploaded
A view called resource-library, which displays all resource library items.
A page template called page--resource_library.html.twig that currently has scaffolding (sidebar etc), then reffers to {{ page.content }} - which renders and loops the resource items from this file - node--resource_library.html.twig
Another file called node--resource_library--full.html.twig which displays full contents of the resource items.
The problem is that when I go to my /node/6 to view a single resource item I can see that it loads from page.html.twig, which does not have the same scaffolding similar to page--resource_library.html.twig.
My question is, is it possible to define the page template that will be used to display a single node? And if not, how do I achieve this? How do I make this specific content type node full views to look different/unique from any other nodes for content types?
Or am I going about this the wrong way? I'm working with Drupal9.
I would like to load the content of a number of related pages for keyword analysis. But when the page title contains parentheses it strips the parentheses and subsequently gives an error. How would I go about loading the content of pages that contain parentheses in the page title? e.g.
https://en.wikipedia.org/wiki/Oil_pump_(internal_combustion_engine)
import wikipedia
automotivedata = wikipedia.page("Oil_pump_(internal_combustion_engine)").content
PageError: Page id "oil_pump_ internal combustion engine" does not match any pages. Try another id!
Just ignore the brackets. Something like this:
print(wikipedia.page("Oil_pump_internal_combustion_engine").content)
September 23, 2019: Issue opened on GitHub (https://github.com/goldsmith/Wikipedia/issues/214)
I have created an app in foursquare, I have the client_id and client_secret key. I need all the venues details. I can only get the venue info, but cannot get the image linked to it.
Please help me . Thanks in advance
https://api.foursquare.com/v2/venues/40a55d80f964a52020f31ee3?client_id=client_id&client_secret=client_secret&v=20161201
In the venue details response there is a photos object under response['photos'] that contains an array of venue photos. To construct the photo url we have documentation here.
From the docs:
To assemble a resolvable photo URL, take prefix + size + suffix, e.g.
https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.
size can be one of the following, where XX or YY is one of 36, 100,
300, or 500.
XXxYY
original: the original photo's size
capXX: cap the photo with a width or height of XX (whichever is larger). Scales the other, smaller dimension proportionally
widthXX: forces the width to be XX and scales the height proportionally
heightYY: forces the height to be YY and scales the width proportionally
you can get photos of a specific venue by this API
http://api.foursquare.com/v2/venues/VENUE_ID/photos?limit=5&client_id=Client_Id&client_secret=Client_Secret&v=20161107
I have project of documentation in gitbook with about of 1000 pages. Result of website generation is set of html files in common size 300 MB. There are 2 causes of such result:
1) All pages listed in SUMMARY.md and as result all generated static htmls has this large menu in 1000 links. The menu is not fully shown thanks to plugin which hides subchapters, but in any case whole menu is inside each html page. If to remove a page link from the SUMMARY.md, the associated html file doesn't generates. Is where any method to generate website with reduce menu (in this case access to subchapters pages will be provided from content of chapters pages)?
2) Big part of the content is not english text, and it translates in sequence of 7-chars codes (like this ģ), how to keep native 1-char symbol?
I'm not sure about your second issue, but it sounds like you can segment the menu as you wish, judging from the theming documentation: https://toolchain.gitbook.com/templating/variables.html
I'm trying to create a theme in orchard. I have a main content zone and a sidebar zone which is on the right of my main content area (2 column layout). The main content area displays a list of blog posts (including tags, etc. Standard Orchard behaviour).
In the sidebar I would like to display the recent blog post widgets. However, the standard widget renders tags, published date etc. I do not want to display this information in the sidebar zone.
The placement file does not seem to be the right place to configure this as I can't specifically target the Parts_Tags_ShowTags shape in the sidebar zone. Neither does it seem to be possible to create a new template like Tags.ShowTags-Sidebar.cshtml
Any suggestions on how to modify/hide a shape in one zone on a page but not the other?
You can either use an alternate (shape tracing can help with that) or take this over entirely (see this post for details: http://weblogs.asp.net/bleroy/archive/2011/03/27/taking-over-list-rendering-in-orchard.aspx)