Can <sitemapindex> contain both <url> and <sitemap> items? - sitemap

Can I put both <url> and <sitemap> index inside my <sitemapindex>? I have a site example.com and my main sitemap stores here example.com/sitemap.xml and contains following:
<sitemapindex>
<url>
<loc>example.com/catalog</loc>
</url>
<sitemap>
<loc>ny.example.com/sitemap.xml</loc>
</sitemap>
<sitemap>
<loc>la.example.com/sitemap.xml</loc>
</sitemap>
</sitemapindex>
So I have a few <url> (which are pages) and a lot of <sitemap> elements (which are sitemapindexes too).
How to organize that structure?

No you can't, because sitemapindex documents can only reference sitemap documents.
See here for more info: http://www.sitemaps.org/protocol.html#index

Related

why is default_head_blocks.xml not removing the css files?

I have put 2 remove tags inside default_head_blocks.xml:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="css/print.css"/>
<remove src="css/styles-m.css"/>
</head>
</page>
The file is under app/design/frontend/<theme>/Magento_Theme/layout/
But the css files are not being removed. Should I put the file in a different directory?
Directory is correct. can you please try to flush cache and check again.

Identify all xml files with specific format

I am trying to find xmls which are not having valid data and not process them. For example , below is a correct xml with all the data available which needs to be processes
(Loop Xpath used to read the data from xml files- Invoicing/Invoice/Serials/SerialNumber):
<?xml version='1.0' encoding='UTF-8'?>
<Invoicing>
<Invoice>
<VendorName>Contec</VendorName>
<InvoicePeriod>May</InvoicePeriod>
<InvoiceDt>2019-05-11</InvoiceDt>
<InvoiceNo>20190511</InvoiceNo>
<Serials>
<SerialNumber>
<TestLoc>HNMA01</TestLoc>
<EISSerial>PKQPLPXJC</EISSerial>
<ComcastModel>PX022ANC</ComcastModel>
<RMANo />
<ReceiptDt>05/09/2019</ReceiptDt>
<RepairDt>05/11/2019</RepairDt>
<Parts>
<Part>
<PartType>Cosmetic</PartType>
<PartId>SERVICEBUFFING</PartId>
<PartDescr>BUFF SERVC</PartDescr>
<ActionCd>RA003</ActionCd>
<FSC>FS005</FSC>
</Part>
</Parts>
</SerialNumber>
</Serials>
</Invoice>
</Invoicing>
I also get XML which are in below format,
<?xml version="1.0" encoding="UTF-8"?>
<Invoicing>
<Invoice>
<VendorName>Contec</VendorName>
<InvoicePeriod>May</InvoicePeriod>
<InvoiceDt>2017-05-01</InvoiceDt>
<InvoiceNo>20170501</InvoiceNo>
<Serials></Serials>
</Invoice>
</Invoicing>
The above xml , even though being valid is not correct..I want to identify the xmls which are in the second format without the complete data and move them into a error folder.
Thanks,
Kavin
Solution to this question is as follows :
I was able to achieve what i wanted with the solution provided by #EdMorton.
grep -L '<SerialNumber>' *.xml
But i wanted to get this done using a xml parser.
count=$(xmllint --xpath "count(//SerialNumber)" "$xml")
When the count is zero i have implemented my logic.
Thanks for all the help.

How to take solr index collection backup?

How to take Solr collection back into lfs or hdfs?
While I am running this query: curl 'quickstart.cloudera:8983/solr/admin/…'; I got error:
ml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">400</int><int name="QTime">0</int></lst><lst name="error"><str name="msg">Unknown action: BACKUP</str><int name="code">400</int></lst> </response>

Joomla Component Develpment: JInstaller: :Install: Cannot find Joomla XML setup file

I developed a joomla component. But I got this error while trying to install it.
"JInstaller: :Install: Cannot find Joomla XML setup file"
Error
Path does not have a valid package.
Below is myforms.xml file
<? xml version = "1.0"encoding = "utf-8" ?>
<extension type="component" version="3.2" method="upgrade">
<name>My Forms!</name>
<creationDate>Sept 09 2014</creationDate>
<author>Toni Ezeamaka</author>
<authorEmail>tons613#ymail.com</authorEmail>
<copyright>A-One GlobalSoft Technologies</copyright>
<version>1.0.1</version>
<description>A component for adding forms to my sites</description>
<installfile>install.php</installfile>
<uninstallfile>uninstall.php</uninstallfile>
<scriptfile>script.php</scriptfile>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql/</schemapath>
</schemas>
</update>
<files folder="site">
<filename>index.html</filename>
<filename>myforms.php</filename>
<filename>controller/myforms.php</filename>
<folder>views</folder>
<folder>models</folder>
</files>
<administration>
<!-- Administration Menu Section -->
<menu>My Forms!</menu>
<files folder="admin">
<filename>index.html</filename>
<filename>myforms.php</filename>
<filename>controller.php</filename>
<folder>sql</folder>
<folder>tables</folder>
<folder>models</folder>
<folder>views</folder>
</files>
</administration>
</extension>
can someone help please?
The Issue was with the space in <? xml
I changed it to <?xml version = "1.0"encoding = "utf-8"?>
and it worked. Thanks to #Irfan

After JUpdate my content position is gone from list - joomla

I used JUpdate to update a joomla 1.5.23 site to 2.5
when i tried to re-link the content area to the article i cant find the position from my main content area in the menu anymore.
the left sidebar is still there and also the right one.
Can anyone shine some light on this? i already tried all the positions from the template twice but i cant seem to find it?
--- template details ---
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd">
<extension version="2.5" type="template" client="site" >
<name></name>
<version>1.0.0</version>
<creationDate>07/2009</creationDate>
<author>SiteGround</author>
<authorEmail></authorEmail>
<authorUrl></authorUrl>
<copyright></copyright>
<license>GNU/GPL</license>
<description>TEMPLATE_DESCRIPTION</description>
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
<filename>templates.php</filename>
<filename>template_preview.png</filename>
<filename>error.php</filename>
<folder>css</folder>
<folder>images</folder>
</files>
<positions>
<position>user4</position>
<position>user3</position>
<position>breadcrumb</position>
<position>user2</position>
<position>left</position>
<position>right</position>
<position>debug</position>
</positions>
<languages>
<language tag="en-GB">en-GB.tpl_siteground-j15-80.ini</language>
</languages>
<administration>
<languages folder="admin">
<language tag="en-GB">en-GB.tpl_siteground-j15-80.ini</language>
</languages>
</administration>
</extension>
I'm not too sure why you used JUpdate to update to 2.5. I personally don't always trust 3rd party extensions to update the CMS as it sometimes causes problems. What you should do is (providing you have a backup of your old 1.6 site):
Upgrade to 1.6.6 by downloading the patch and extracting it via FTP on to the root of your site
IN the Joomla Backend, go to Extensions >> Extension Manager >> Find Updates
If you can't find any updates, then go to Options and select the Long Term Release. Once saved, Purge Cache and try to find updates again.
Update:
change this:
<?php if($this->params->get('showComponent')) : ?>
<jdoc:include type="component" />
<?php endif; ?>
to this:
<jdoc:include type="component" />
So basically remove the PHP that is wrapped around

Resources