andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
I have images in the beginning of my pages which I want to show in their excerpts. I tried commenting out
$excerpt = htmlspecialchars_decode($excerpt);
in pages_exerpts.php
it worked on my localhost server but not online which showed the damaged image icon instead of the images.
How do I make the images appear in the excerpts?
[EDIT] Also, the text loses its formatting and line breaks. I want it to maintain its formatting.
(This post was last modified: 2012-04-03 23:39:03 by karentsui.)
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
Doesn't using the built-in code do this:
Code:
<?php get_page_excerpt($length, 'false'); ?>
Or are you talking about having excerpts in search results as opposed to displaying the excerpt on the beginning of the page itself?
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
I have many child pages whose excerpts I want to display on the parent page. Ideally I would have used the News Manager if it supported categories because I need to do it for many parent pages.
There are images on the top of the child pages which I want to display in the excerpt on the parent page.
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
Install I18N Search, then on your parent page put the following content in:
Code:
(% searchresults tags="_parent_SLUG" numWords="Xp" %)
Replacing SLUG with the slug of the parent and X with the maximum number of paragraphs you want to display in your excerpt. This method maintains whatever formatting exists (so images are included; I've tested this) so long as it is within the X number of <p> tags you specified.
You can style the look of these search results either by creating a component specially for the page or using Special Pages and styling it from that plugin.
Hope this works for you!
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
Angryboy wrote:(% searchresults tags="_parent_SLUG" numWords="Xp" %)
I am getting "no results found."
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
4 questions then:
[list=*]
[*]What plugins do you have installed?[/*]
[*]What settings do you have for your parent page(s)?[/*]
[*]What is the navigational structure of your parent/child pages?[/*]
[*]What is the exact content that you have pasted onto the parent page(s)?[/*]
[/list]
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
List of plugins installed:
DynPages
FAQ
I18N Base
I18N Custom Fields
I18N Gallery
I18N Navigation
I18N Search
Innovation Theme Settings
News Manager
p01-contact
Excerpts
Sitemap
what setting do you have for the parent page?
Didn't quite understand this one.
What is the navigational structure of your parent/child pages?
parent page
- child page1
- child page2
- child page3
What is the exact content that you have pasted onto the parent page(s)?
(% searchresults tags="_parent_writeups" numWords="2p" %)
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
Thanks for giving me all this information. I've set up a fresh install of GetSimple with the latest versions of all of these plugins just to see what happens, but I still have not encountered this problem. By any chance, are you using the latest version of I18N Search (since the _parent_ functionality was added to the most recent update)?
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
(This post was last modified: 2012-04-06 05:53:21 by logonsf.)
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
Great. My search version was older. Now it works. How do I remove the words 'Search Results' and 'en' from the displayed results.
I understand I can remove the bullets through css styling. But I also need to remove the words 'search results' and 'en'.
[EDIT] Solved it through the following css.
ul.search-results {list-style:none;margin:0;padding:0;}
li.search-entry {clear:both;list-style:none;}
.search-header {display:none;}
.search-entry-language {display:none;}
(This post was last modified: 2012-04-06 17:23:39 by karentsui.)
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
But now there is a new problem. With the page excerpts there was a 'more' link at the end of the text, letting viewers know that they need to click on a link to read more text. With the search results approach, there is nothing in the text to let the viewers know that there is more article to be viewed.
|
|
|
|
mvlcek
Posting Freak
Posts: 1,734
Joined: Jan 2011
|
images in pages_excerpts
andyash wrote:How do I remove the words 'Search Results' and 'en' from the displayed results.
Code:
(% searchresults tags="_parent_writeups" numWords="2p" HEADER="" showLanguage=0 %)
All parameters are listed in Plugins/Configure I18N Search/Usage.
You can also globally switch off showLanguage in Plugins/Configure I18n Search/Settings.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
andyash wrote:But now there is a new problem. With the page excerpts there was a 'more' link at the end of the text, letting viewers know that they need to click on a link to read more text. With the search results approach, there is nothing in the text to let the viewers know that there is more article to be viewed.
With custom rendering you can do this. Create a component and give it the following code:
Code:
<h3 class="search-entry-title">
<?php if ($showLanguage) { ?>
<span class="search-entry-language">
<?php echo htmlspecialchars($item->language, ENT_NOQUOTES); ?>
</span>
<?php } ?>
<a href="<?php echo $item->link; ?>">
<?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?>
</a>
</h3>
<?php if ($showDate) { ?>
<div class="search-entry-date">
<?php echo strftime($dateFormat, $item->pubDate); ?>
</div>
<?php } ?>
<div class="search-entry-excerpt">
<?php echo $item->getExcerpt($item->content, $numWords); ?>
</div>
<div class="search-entry-more"><a href="<?php echo $item->link; ?>">...more</a></div>
Then within your (% %) brackets, paste
Code:
component="COMPONENTSLUG"
With the component slug being the exact slug of the component you just defined (as a piece of advice, avoid having spaces and capital letters in your slug since that can introduce problems sometimes).
You can add virtually anything you want within the component to be displayed per-search-result. For example if you wanted to have a piece of information from a Customfield of yours, simply use:
<?php echo $item->fieldname; ?>
or
<?php echo htmlspecialchars($item->fieldname, ENT_NOQUOTES); ?>, depending on which one suits your needs. Have a fiddle around with the markup of your component until you've got what you are looking for.
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
(This post was last modified: 2012-04-06 17:43:41 by logonsf.)
|
|
|
|
mvlcek
Posting Freak
Posts: 1,734
Joined: Jan 2011
|
images in pages_excerpts
andyash wrote:But now there is a new problem. With the page excerpts there was a 'more' link at the end of the text, letting viewers know that they need to click on a link to read more text. With the search results approach, there is nothing in the text to let the viewers know that there is more article to be viewed.
Using numWords="2pm" will add "..." (but no link - the user needs to click on the header of the item):
Code:
(% searchresults tags="_parent_writeups" numWords="2pm" HEADER="" showLanguage=0 %)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
Quote:(% searchresults tags="_parent_writeups" numWords="2pm" HEADER="" showLanguage=0 %)
not working.
(This post was last modified: 2012-04-06 23:55:52 by karentsui.)
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
Angryboy wrote:With custom rendering you can do this. Create a component and give it the following code:
Code:
<h3 class="search-entry-title">
<?php if ($showLanguage) { ?>
<span class="search-entry-language">
<?php echo htmlspecialchars($item->language, ENT_NOQUOTES); ?>
</span>
<?php } ?>
<a href="<?php echo $item->link; ?>">
<?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?>
</a>
</h3>
<?php if ($showDate) { ?>
<div class="search-entry-date">
<?php echo strftime($dateFormat, $item->pubDate); ?>
</div>
<?php } ?>
<div class="search-entry-excerpt">
<?php echo $item->getExcerpt($item->content, $numWords); ?>
</div>
<div class="search-entry-more"><a href="<?php echo $item->link; ?>">...more</a></div>
Then within your (% %) brackets, paste
Code:
component="COMPONENTSLUG"
With the component slug being the exact slug of the component you just defined (as a piece of advice, avoid having spaces and capital letters in your slug since that can introduce problems sometimes).
You can add virtually anything you want within the component to be displayed per-search-result. For example if you wanted to have a piece of information from a Customfield of yours, simply use:
<?php echo $item->fieldname; ?>
or
<?php echo htmlspecialchars($item->fieldname, ENT_NOQUOTES); ?>, depending on which one suits your needs. Have a fiddle around with the markup of your component until you've got what you are looking for.
This worked well. Thanks.
(This post was last modified: 2012-04-07 04:00:03 by karentsui.)
|
|
|
|
Angryboy
Member
Posts: 180
Joined: Sep 2010
|
images in pages_excerpts
No problem *thumbs up* If you want to make any more changes to the displaying of your results but are unsure of how exactly, feel free to ask.
In the middle of migrating content from Spriting on a Whim (soaw.hostingsiteforfree.com) to LOKIDA (lokida.co.uk) - all my GetSimple tutorials will be hosted there.
|
|
|
|
andyash
Member
Posts: 173
Joined: Apr 2010
|
images in pages_excerpts
Thanks. will do.
|
|
|
|