में breadcrumb एसईओ के लिए microdata या schema.org जोड़ना मैं वर्तमान में microdata और schema.org के बारे में थोड़ा उलझन में हूँ। क्या microdata और schema.org समान है? मैंने Google और Microsoft दस्तावेज पढ़ा, लेकिन इससे मुझे इन दो नामों के बीच अंतर प्राप्त करने में मदद नहीं मिली। बहुत ज्यादा भूमि के ऊपर है, लेकिन ठीक है, तो खोज परिणाम अच्छे लग रहेDrupal 7
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/" itemprop="url"><span itemprop="title">My Page</span></a>
</span>
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/cat1" itemprop="url"><span itemprop="title">Category 1</span></a>
</span>
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/cat1/content" itemprop="url"><span itemprop="title">Content</span></a>
</span>
मेरी राय में:
अब तक मैं इस मैं का उत्पादन किया है इस एचटीएमएल कोड को समझा। क्या एचटीएमएल कोड की गिनती को कम करना संभव है?
अगर मुझे की आवश्यकता नहीं है तो खोज इंजन दो अलग-अलग ट्रेल्स का पता कैसे लगाता है?
मेरी अगली समस्या यह है कि मैं इस प्रारूप को ड्रूपल ब्रेडक्रंप पर लागू करना चाहता हूं।
function mymod_page_alter(&$variables) {
if (!isset($variables['breadcrumb'])) {
$variables['breadcrumb'] = theme('my_microdata', array('breadcrumb' => drupal_get_breadcrumb()));
}
}
function mymod_theme($existing, $type, $theme, $path) {
return array(
'my_microdata' => array(
'variables' => array('breadcrumb' =>array()),
),
);
}
function mymod_menu_breadcrumb_alter(&$active_trail, $item){
foreach($active_trail as $id=>$active_trail_item){
$active_trail[$id]['localized_options']['attributes']['itemprop'][]="url";
}
}
function theme_my_microdata($variables){
$breadcrumb=$variables['breadcrumb'];
print_r(debug_backtrace());
$output="*+*+*+*+*";
if (!empty($breadcrumb)) {
// Provide a navigational heading to give context for breadcrumb links to
// screen-reader users. Make the heading invisible with .element-invisible.
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
$output .= '<div class="breadcrumb">';
$separator="";
foreach($breadcrumb as $breadcrumb_item){
$output.='<span typeof="datav:Breadcrumb">'.$separator.$breadcrumb_item."</span>";
$separator="»";
}
$output .='</div>';
}
return $output."xXxXxXx";
}
अब तक मैं जाँच की है कि यह सब कोड निष्पादित होने मैं वेब this fix जो मैं इस तरह मेरे अपने एसईओ मॉड्यूल को शामिल करने की कोशिश की पर पाया। लेकिन यह थीम मेरे पृष्ठ पर लागू नहीं है। वह कोड क्यों काम नहीं करता है? क्या यह मॉड्यूल breadcrumb
से संबंधित हो सकता है? मुझे पता है कि यह आउटपुट कचरा होगा लेकिन मैं परिणाम नहीं देख सकता।
यदि मुझे लगता है कि मेरे कोड के बजाय theme.inc लाइन 1682ff theme_breadcrumb(...)
द्वारा निर्मित आउटपुट की तुलना में सही लगता है।
यह अच्छा होगा अगर कोई मेरी मदद कर सके, भले ही आप मेरे सवालों के सभी उत्तरों को नहीं जानते!
मार्कअप के बारे में बहुत अच्छा सवाल है, लेकिन मुझे लगता है कि आपको ड्रूपल के बारे में सामान लेना चाहिए और इसे एक अलग प्रश्न में ले जाना चाहिए – Baumr