Plone 4x: Can I get the title of a folder for the page content - plone

I was wondering if I could get the folder title for page content in a template. Right now the code in the template is:
<div>
<metal:field use-macro:"python:here.widget('title', mode='view')">
Title
</metal:field>
</div>
This is for a news item. I would like to change this so that instead of the title of the news item, it would be the the title of the parent folder for the news item. I am new to Plone. Thank you in advance.

Try replacing your div with something like:
<div>
<h1 id="parent-fieldname-title" class="documentFirstHeading"
tal:content="python:context.aq_parent.title">
Title
</h1>
</div>

Related

WordPress - Excluding div container from next pagination page

I have such a text container. He would like it to appear only on the first page of the blog's pagination.
<div class="column mcb-column mcb-item-c0belar2g one column_visual">
<h2>Title</h2>
<p>Lorem Ipsum Dolor</p>
</div>
I have a text container generated by Muffin Page Builder in WordPress. He would like it to appear only on the first page of the blog's pagination. I tried to create a code like this:
if (1 == $ paged) {
your container code
}
Unfortunately it doesn't work and I don't know if I need to create a function to hide this container on the following pages of pagination?
Here is a link to this blog page
I am trying to find information on the Internet, but so far I have not been able to find anything about it. Please help.
Image of this container

Woocommece - how to change the layout of shortcode template

I am using this shortcode to show all products of a specific product category on custom a template.
[products limit="12" columns="3"]
Now, as I am developing a new theme so the output of this shortcode is breaking the design.
I want to know where or which file I should take or edit to change the layout I want?
Check this image:
Here you can see the rectangle box div's is coming from the content-product.php page but I want to add/change few div before that div's
Like where the <div class="row"> and <div class="woocommerce columns-3 "> is coming? I want to change it.

WordPress CPT show content in div on same page when link clicked

I have a WordPress Custom Post Type called vacancies.
On my vacancies archive page, I wish to have a list of the latest vacancies with small excerpts (which I have).
When I click the "read more" link under each vacancy, I want the content of the CPT to appear on the same page in another div. When I click another link, I then want it to change the div content to the new CPT content, without reloading the archive page.
I hope this makes sense?
<ul class="vacancies-list">
<li>
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
<li>
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
<li>
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
</ul>
<div class="vacancy-content">
<p>When "read more clicked, I want content of CPT pulled here</p>
</div>
There are two ways:
Either Add an AJAX Funtion, which dynamically loads the contents of your cpt when users click the "Read More". It basically is a way to execute a regular WP_Query statement using JavaScript. You can find plenty of goog tutorials online on how to implement such a thing based on your included libraries. Personally I tend to use jQuery and it's .ajax() function. - This method will ensure you have a quick initial load time of your page but there will be a slight delay between clicking "Read More" and the content being displayed.
Or Load the content in a hidden div and then just toggle the visiblity of said div using JS. Add a unique identifier to your list-items. This should then help you identify the post and then show the corresponding content in the Vacancy-content. Something like this to clarify:
<ul class="vacancies-list">
<li data-post="1">
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
<li data-post="2">
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
<li data-post="3">
<h2>Vacancy title</h2>
<p>Vacancy CPT Excerpt</p>
Read more
</li>
</ul>
<div class="vacancy-content">
<div class="content post-1">Lorem Ipsum</div>
<div class="content post-2">Lorem Ipsum</div>
<div class="content post-3">Lorem Ipsum</div>
</div>
All content in vacancy-content is hidden. On ReadMore-Click hide all content and then show the content based on the li's data-attribute.
This Method will cause a slightly higher intial load time but will display the new content immediatly

How to link child pages in Wordpress to the parent?

Odd question and maybe my logic is off on this one, but I have this structure in Wordpress:
Page 1
Child page of page 1
Child page of page 1
Page 2
Child page of page 2
Child page of page 2
Child page of page 2
In my theme I output this as one page per parent.
For example:
The layout is
<h1>title of page 1</h1>
<p>content of page 1</p>
After that a few small blocks:
<div class="box first child-page">
box with content of child page of page 1
</div>
<div class="box second child-page">
box with content of child page of page 1
</div>
<div class="box last child-page">
box with content of child page of page 1
</div>
But; now my problem! When someone uses the search box, The child pages, with their unique permalink are also shown, which is correct, but I need them to link to the parent page. Child pages should not be visited as a unique page, but the content has to be searchable (because, the content does exist on the webpage). Hope you guys understand what I'm trying to tell. I tried to 301 redirect the child pages to the parent page, but I need something easier for my client to be able to create child pages, and not having to worry about 301 redirects.
Regards.
to get parent url you can do this inside the loop of child page
<?php
$parent = get_permalink($your_child_loop_variable->post_parent);
?>

drupal 7: custom design theme a block created with the Views module

i create block with views module for Print Promoted to front page, this worked and i see result in my front page. this views worked with field and i print title, thumbs, content. now i need to custom this theme views for show in jquery content slider.
i click in advanced->theme->information i see this:
field content revision: views-view-field.tpl.php, views-view-field--title.tpl.php, views-view-field--frontpage.tpl.php, views-view-field--frontpage--title.tpl.php, views-view-field--block.tpl.php, views-view-field--block--title.tpl.php, views-view-field--frontpage--block.tpl.php, views-view-field--frontpage--block--title.tpl.php, views-view-field--block-1.tpl.php, views-view-field--block-1--title.tpl.php, views-view-field--frontpage--block-1.tpl.php, views-view-field--frontpage--block-1--title.tpl.php
But i don't find any .tpl.php theme files for edit theme design using html and css. how to create custom design theme for print my result with this format:
<div id="content">
<ul>
<li>
<div class="title">title1</div>
<div class="thumbs"><img 1 ......></div>
<div class="content">content1</div>
</li>
<li>
<div class="title">title2</div>
<div class="thumbs"><img 2 ......></div>
<div class="content">content2</div>
</li>
</ul>
</div>
I think the Views 2 theming guide has already explained everything clearly. Just follow the steps there and it only takes just minutes.

Resources