Conversion from HTML to Joomla is not working - joomla

I am new to Joomla and I am customizing theme from HTML to joomla 3.My folder structure is like
--mysite
|
--CSS
--Images
--index.php
--index.html
--templateDetails.xml
index.php:
<?php
defined('_JEXEC') or die;
$doc = JFactory::getDocument();
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap-responsive.css');
$doc->addScript($this->baseurl . '/media/jui/js/jquery.min.js');
$doc->addScript($this->baseurl . '/media/jui/js/bootstrap.min.js');
JHtml::_('jquery.framework');
JHtml::_('bootstrap.framework');
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<jdoc:include type="head" />
<link rel="stylesheet" type="text/css" href="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/css/templatemo_style.css"/>
</head>
<body>
<!--
This is a free CSS template provided by templatemo.com
-->
<div id="templatemo_container_wrapper">
<div class="templatemo_spacer"></div>
<div id="templatemo_container">
<div id="templatemo_top"> Website Templates · Flash Templates · Company · Contact</div>
<div id="templatemo_header">
<div id="inner_header">
<jdoc:include type="component" />
</div>
</div>
<div id="templatemo_left_column">
<div class="section_box2" align="justify">
<div class="text_area">
<img src="images/s_flashmo_022_park_34.jpg" alt="Photo One" title="Photo One" width="120" height="90" class="templatemo_pic" />
<jdoc:include type="module" name="left" style="none" />
</div>
</div>
</div>
</div>
<div id="templatemo_right_column">
<ul class="templatemo_menu">
<jdoc:include type="module" name="right_menu" style="none" />
</ul>
<div class="section_box" align="justify">
<jdoc:include type="module" name="right_content" style="none" />
</div>
</div>
<div id="templatemo_footer">
<jdoc:include type="module" name="footer" style="none" />
</div>
</div>
<div class="templatemo_spacer"></div>
</div>
</body>
</html>
templateDetails.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE install PUBLIC "-//Joomla! 2.5//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/2.5/template-install.dtd">
<extension
version="3.1"
type="template"
client="site">
<name>MySite</name>
<creationDate>01/10/2014</creationDate>
<author>Rohil</author>
<authorEmail>rohilmistry#xyz.com</authorEmail>
<authorUrl>rohilmistry.com</authorUrl>
<copyright>Copyright Rohil</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.0</version>
<description>Site Description goes here ...</description>
<files>
<folder>images</folder>
<folder>css</folder>
<filename>index.php</filename>
<filename>index.html</filename>
<filename>templateDetails.xml</filename>
</files>
<positions>
<position>top_header</position>
<position>left</position>
<position>right_menu</position>
<position>right_content</position>
<position>footer</position>
</positions>
</extension>
And it is giving me this output and I want to achieve this.
Any Help would be appreciated.

Related

Vue components not loading but router-views loads normally

I'm trying to figure out why on earth I can load my component through router-view but not by calling the component itself.
In my blade file when I write '<router-view />', It loads my CategoryDropdown component normally but when I write CategoryDropdown It disappears and I get this console error:
'app.js:7307 [Vue warn]: Failed to resolve component: categorydropdown
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
at <App>'
Here is the code for my app.js:
require("./bootstrap");
import Alpine from "alpinejs";
window.Alpine = Alpine;
Alpine.start();
import { createApp } from "vue";
import router from "./router";
import CategoryDropdown from "./components/categories/CategoryDropdown";
import vClickOutside from "click-outside-vue3";
createApp({
components: {
CategoryDropdown,
},
})
.use(router, vClickOutside)
.mount("#app");
Here is the blade file noting that if i simply replaced this with it will work:
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<header class="max-w-xl mx-auto mt-10 text-center">
<h1 class="text-4xl">
<span class="bg-gradient-to-r from-green-300 via-blue-500 to-purple-600 px-2 py-1 rounded-xl text-white">
Hands On Tech</span>
blog
</h1>
<h2 class="inline-flex mt-2 items-center">
By Mostafa Said
<img class="wavingHand" src="/images/wavinghand.png" width="35px" alt="Waving Hand" />
</h2>
<p class="text-sm mt-5">
Come'on in and check out my latest blog posts. I'm sharing whatever on
my mind and my mind is full of useful stuff for you'all.
</p>
<div class="space-y-2 lg:space-y-0 lg:space-x-4 mt-8">
<!-- Category -->
<div class="override relative lg:inline-flex items-center bg-blue-100 rounded-xl">
<CategoryDropdown />
<!-- This works -->
<!-- <router-view /> -->
</div>
<!-- Search -->
<div class="override flex lg:inline-flex items-center bg-blue-50 rounded-xl px-3 py-2">
<form method="GET" action="#">
<input type="text" name="search" placeholder="Looking for something?" class="shadow-none focus:shadow-none bg-transparent placeholder-black text-sm border-none outline-hidden" />
</form>
</div>
</div>
</header>
This is the layout:
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="High quality Web Development articles" />
<meta property="og:title" content="Hands On Tech Blog" />
<meta property="og:description" content="High quality Web Development articles" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://" />
<meta property="og:url" content="https://" />
<title>Hands On Tech Blog</title>
<link rel="stylesheet" href="{{ asset('/css/app.css') }}" />
<link rel="stylesheet" href="/override.css" />
<script src="{{ asset('js/app.js') }}" defer></script>
</head>
</html>
I want to be able to see my component when I call it in blade like this '' instead of using ''

CSS doesn't effect in blade

I'm encountering a problem today: I just created a new blade view that displays my HTML, but my CSS doesn't work! I tried several ways like putting it directly on the page, putting it outside my layout, nothing to do... it works on all my other pages that are exactly the same place on my workspace.
Here is my blade file:
#extends('layouts.default')
#section('content')
<section class="blog-outer-area mt-5">
<div class="content-area">
<div class="blog-area-sec">
<!-- Start: Blog Sec -->
<div class="blog-sec">
<div class="container">
<!-- Start:Blog Area -->
<div class="blog-inner-area row">
<!-- Start:Blog Left Content-->
<div class="col-lg-8 left">
<div class="item-box">
<div class=" img-holder">
<img src="template/img/home-blog-1.jpg" alt="">
</div>
<div class=" img-holder">
<img src="template/img/home-blog-1.jpg" alt="">
</div>
<div class="info-text-holder">
<h4>{{ $article->titre }}</h4>
<span>{{ $article->created_at->format('d/m/Y') }}</span>
<p>{{ $article->description }}</p>
<ul class="social-icon-simple">
<li><i class="fa fa-facebook"></i></li>
</ul>
</div>
</div>
</div>
<!-- End:Blog Left Content-->
<!-- Start:Blog Right Content-->
<div class="col-lg-4 ">
<div class="right">
<input type="text" name="search" class="search-btn" placeholder="Search Here">
<!-- Start:Recent Posts-->
<h5>Recent posts</h5>
<ul class="recent-post">
<!-- Start:Post 1-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-4.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>Stetina savours Tour de France return</p>
</div>
</div>
</div>
</li>
<!-- End:Post 1-->
<!-- Start:Post 2-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-5.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>Top Fitness Gear to Help You Workout</p>
</div>
</div>
</div>
</li>
<!-- End:Post 2-->
<!-- Start:Post 3-->
<li>
<div class="row">
<div class="col-lg-5">
<img src="template/img/blog-6.jpg" alt="">
</div>
<div class="col-lg-7">
<div class="text">
<p>The Southern Ocean is the 'newest' named ocean</p>
</div>
</div>
</div>
</li>
<!-- End:Post 3-->
</ul>
<!-- End:Recent Posts-->
</div>
</div>
<!-- End:Blog Right Content-->
</div>
<!-- End:Blog Area -->
</div>
</div>
<!-- End: Blog Sec -->
</div>
</div>
</section>
#endsection
My Layout integrations:
<link type="text/css" rel="stylesheet" href="template/css/bootstrap.min.css"><!-- Bootstrap -->
<link type="text/css" rel="stylesheet" href="template/font-awesome/css/font-awesome.min.css"><!-- font-awesome -->
<link type="text/css" rel="stylesheet" href="template/css/animate.min.css"><!-- Animation -->
<link type="text/css" rel="stylesheet" href="template/css/flexslider.css"><!-- FlexSlider CSS -->
<link type="text/css" rel="stylesheet" href="template/css/style.css"><!-- Light Theme Core CSS -->
<!-- Google Fonts here -->
<link href="template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
<link href="template/css/fonts/open-sans.css" type='text/css'>
<link href="template/css/fonts/lato.css" rel='stylesheet' type='text/css'>
My workspace looks like this:
Try this
<link type="text/css" rel="stylesheet" href="/template/css/bootstrap.min.css"><!-- Bootstrap -->
<link type="text/css" rel="stylesheet" href="/template/font-awesome/css/font-awesome.min.css"><!-- font-awesome -->
<link type="text/css" rel="stylesheet" href="/template/css/animate.min.css"><!-- Animation -->
<link type="text/css" rel="stylesheet" href="/template/css/flexslider.css"><!-- FlexSlider CSS -->
<link type="text/css" rel="stylesheet" href="/template/css/style.css"><!-- Light Theme Core CSS -->
<!-- Google Fonts here -->
<link href="/template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
<link href="/template/css/fonts/open-sans.css" type='text/css'>
<link href="/template/css/fonts/lato.css" rel='stylesheet' type='text/css'>

Laravel blade. Blade doesn't work

I have route
Route::get("/prodByCat/{category_id}", "ProductController#productsByCategory")->name("product.productsByCategory");
and function
public function productsByCategory($category_id){
$products = Product::where('category_id', $category_id)->get();
return view("cat", compact("products"));
in my template i have only
#extends("index")
#section("content")
#foreach($products as $product)
{{ $product->name }}
#endforeach
#endsection
Problem is - links to bootstrap and custom css doesn't inherits. I tried to create another controller and new template file. But nothing works, except deleting {category_id} from Route. Why passing {category_id} conflicts with links to css files?
I tried composer dump-autoload and reboot computer.All other templates work properly.
My index template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>#yield("title")</title>
#yield("css")
<!-- Bootstrap core CSS -->
<link href="files/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="files/shop-homepage.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
#include("layouts._shopNav")
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-3">
#yield('category')
</div>
<!-- /.col-lg-3 -->
<div class="col-lg-9">
#yield("carousel")
<div class="row">
#yield("content")
</div>
<!-- /.row -->
</div>
<!-- /.col-lg-9 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="fixed-bottom py-3 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Some writing<br></p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script src="files/jquery/jquery.min.js"></script>
<script src="files/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>
The problem is that the wrong path of the css files. You can use
{{ asset('files/jquery/jquery.min.js') }}
to make sure that the path is correct.

Why bootstrap not working in MS Visual Studio 2010

A newly installed visual studio 2010. Then i tried to add bootstrap for better design but its not working
Here is my code
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="mySample.Main" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
<link href="contents/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css" />
<link href="contents/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div class="navbar navbar-fixed-top navbar-default" role="navigation" >
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Job Order System</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Closed Request</li>
</ul>
</div>
</div>
</div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/jquery-2.1.0.min.js") %>"></script>
<script type="text/javascript" src="<%= Page.ResolveUrl("~/script/bootstrap.min.js") %>"></script>
</body>
</html>
It only display a normal list
Please help me solving this kind of problem. Thank you so much
I see 2 potential problems:
You're using a relative URI in the <link /> elements, this won't be a problem if every page is in the root of your website, but it's good practice to make these Application-root-relative URIs. Add runat="server" to the element and begin the href with ~/ and ASP.NET will automatically give it a correct URI
You've put the <link /> inside <asp:ContentPlaceHolder elements, which means they're the "default content" of the placeholders. If any of your pages set content for that placeholder then the default content (i.e. your bootstrap links) will be removed.

Inconsistency in the mapping of resources in a Spring project

In my Spring project, one of the my controllers have the following views:
login -> /WEB-INF/jsp/acesso/login.jsp
logout -> /WEB-INF/jsp/acesso/logout.jsp
start -> /WEB-INF/jsp/acesso/start.jsp
which are working almost fine, except with this little problem with the the first view (login):
When I call it for the first time (aka, when I start the application), the page is displayed correctly. But after I call logout from inside start, I have a link to login. When I click in this link, the view login is displayed wrong, without reach none of the css files included in the html code.
The JSP files above are:
login.jsp
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>HorarioLivre - Login</title>
<link href="<c:out value="bootstrap/css/bootstrap.min.css"/>" rel="stylesheet">
<link href="<c:out value="extras/css/signin.css"/>" rel="stylesheet">
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
</head>
<body>
<div class="container">
<form class="form-signin" role="form" method="post" action="<c:out value="acesso/doLogin.html"/>">
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" name="username" placeholder="Username" required autofocus>
<input type="password" class="form-control" name="password" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>
start.jsp
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>HorarioLivre</title>
<!-- Bootstrap core CSS -->
<link href="<c:out value="../bootstrap/css/bootstrap.min.css"/>" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="<c:out value="../extra/css/starter-template.css"/>" rel="stylesheet">
<script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">HorarioLivre</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li>Eventos</li>
<li>Listar Horários</li>
<li>Cadastrar Horários</li>
<li>Usuários</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
${usuario.primeiroNome} ${usuario.ultimoNome}<b class="caret"></b>
<ul class="dropdown-menu">
<li>Perfil</li>
<li>Configurações</li>
<li>Sair</li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<div class="starter-template">
</div>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="<c:out value="../jquery/js/jquery-2.1.0.min.js"/>"></script>
<script src="<c:out value="../jquery/js/jquery-ui-1.10.4.custom.min.js"/>"></script>
<script src="<c:out value="../bootstrap/js/bootstrap.min.js"/>"></script>
</body>
</html>
logout.html
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Saida do sistema</title>
<!-- Bootstrap core CSS -->
<link href="<c:out value="../bootstrap/css/bootstrap.min.css"/>" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="<c:out value="../extra/css/jumbotron-narrow.css"/>" rel="stylesheet">
<script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
</head>
<body>
<div class="container">
<div class="header">
<h3 class="text-muted">HorarioLivre</h3>
</div>
<div class="jumbotron">
<h1>Você saiu do sistema</h1>
<p class="lead"></p>
<p><a class="btn btn-lg btn-success" href="<c:out value="login.html"/>" role="button">Entrar novamente</a></p>
</div>
<div class="footer">
<p>Kleber Mota de Oliveira © 2014</p>
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>
Someone knows how to correct set the mapping for this files, to work don't matter how it's called?
ps.: my web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>HorarioLivre2</display-name>
<welcome-file-list>
<welcome-file>acesso/login.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>HorarioLivre2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HorarioLivre2</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
my HorarioLivre2-servlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<context:component-scan base-package="com.horariolivre"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<context:annotation-config>
<bean class="com.horariolivre.resources.HibernateConfig">
</bean>
</context:annotation-config>
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
In your HorarioLivre2-servlet.xml it seems that you have not mapped the static resources. Check out this link to see how this is done

Resources