Google Sitemap Lite
ExpressionEngine 2, ExpressionEngine 3
Back to this add-on's main page
View Other Add-ons From Rein de Vries
Closed Entries
General
Blis Web Agency
|
Posted: 06 May 2014 01:06 AM |
|
|
|
Hi Rein,
You may already be across this one but I noticed that you’re not checking the Status of an entry before it’s included in the sitemap. For example this code:
{exp:google_sitemap_lite:generate type=“structure” mode=“all” hide_from_nav=“yes”}
Produces a list of all Structure Pages and Entries regardless of whether they are opened or closed.
I had a look at a work around for this one and came up with some thing like this:
//Get last segment in URL $bits = explode("/", $val['url']); $lastbit = end($bits); $status = "open";
//Find It $results = $this->EE->db->get_where('structure_listings', array('uri' => $lastbit)); if($results->num_rows() > 0 ) { if ($results->num_rows() == 1) {
foreach($results->result() as $result) { //set the table $entry_id = $result->entry_id; }
} else { //As there should never be more than 1, set to open... $status = "open"; }
}
$results = $this->EE->db->get_where('channel_titles', array('entry_id' => $entry_id)); //Default to Open if($results->num_rows() > 0 ) { foreach($results->result() as $result) { //set the table $status = $result->status; } }
if ($status == 'closed') { continue; }
It’s pretty hacky but is getting the job done.
Any chance of adapting something like this into a future build?
Cheers,
Sam
|
|
|
Reinos
|
Posted: 06 May 2014 02:39 AM |
# 1
|
|
Developer
|
Hi Sam,
I opensourced the project on Github. You can make there a pull request ;-)
https://github.com/reinos/ee_google_sitemap_lite
Best,
Rein
|
|
|
Blis Web Agency
|
Posted: 06 May 2014 02:47 AM |
# 2
|
|
|
Good thing. Thanks Rein.
|
|
|