Cube Creative Design worked with I Just Want To Sleep in the Asheville area to create a custom responsive and search engine optimized website built with WordPress.
{source}<?phpuse Joomla\CMS\Uri\Uri;
// Get the current view
$input = $app->input;
$view = $input->get('view');
$layout = $input->get('layout');
// Get the page title
$pageTitle = $document->getTitle();
// Initialize category title variable
$categoryTitle = '';
// Check if the view is an article or a category
if ($view === 'article' && isset($article)) {
// Get the category id from the article object
$categoryId = $article->catid;
// Load the category
$category = \JCategories::getInstance('Content')->get($categoryId);
$categoryTitle = $category->title;
} elseif ($view === 'category') {
// Get the category id
$categoryId = $input->getInt('id');
// Load the category
$category = \JCategories::getInstance('Content')->get($categoryId);
$categoryTitle = $category->title;
}
//
// echo "<pre>";
// echo 'View: ' . htmlspecialchars($view) . '<br>';
// echo 'Layout: ' . htmlspecialchars($layout) . '<br>';
// echo "View later: " . htmlspecialchars($viewLater) . '<br>';
// $currentView = $app->get('current_view_for_sourcer', '');
// $bodyClassMenu= $app->get('bodyClassMenu', '');
// echo 'Current View Passed: '.$currentView.'<br>';
// echo 'Body Class Passed: '.$bodyClassMenu.'<br>';
// echo "<br>";
// echo "Current view: " . htmlspecialchars($input->get('view'));
// echo 'Page Title: <h1>' . htmlspecialchars($pageTitle) . '</h1>';
// echo "</pre>";
//
// Output the titles and view with conditional HTML elements
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-xs-12">';
echo '<div class="holder">';
//echo "blog/".$article->category_alias;
$varURL = Uri::getInstance()->toString();
$varURLParts = parse_url($varURL);
$varCategoryFlag = null;
foreach ($varURLParts as $component => $value) {
if ($component === 'path') {
$value = substr($value, 0, strrpos($value, '/'));
}
$arrURLComponents[$component] = ucfirst($component) . ": $value";
$arrURLValue[$component] = $value;
};
//echo "<pre>";
//var_dump ($arrURLValue);
//echo "</pre>";
//echo '<a href="'.htmlspecialchars($arrURLValue['path']).'">'.htmlspecialchars($arrURLValue['path']).'</a>';
if ($view === 'article') {
echo '<!--article--><div class="header"><a href="'.htmlspecialchars($arrURLValue['path']).'"> ' . htmlspecialchars($categoryTitle) . '</a></div>';
} elseif ($view === 'category') {
echo '<!--category--><h1 class="header"><a href="'.htmlspecialchars($arrURLValue['path']).'">' . htmlspecialchars($categoryTitle) . '</a></h1>';
} else {
echo '<!--else--><h1 class="header">' . htmlspecialchars($categoryTitle) . '</h1>';
};
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
?>{/source}
