Closed iamtomc closed 3 years ago
@brandsafric Hello, please share to navigation menu ss and If you get a javascript error can you please send it as well? Thanks
Hello @anilsahindev and @jsdecena, please I don't get what you mean kindly enlighten me as to what to do I don't see any share buttons here...
Anyway in regards to the problems I was facing this is what I did; I modified 2 files (HomeController and index.blade.php). in mine HomeController (in App\Http\Controllers\Front), I modified the bottom of index method to the following:
$categories = $this->categoryRepo->listCategories();
return view('front.index', compact('cat1', 'cat2','categories'));
then in mine index page (resources/views/front/index.blade.php) and added the following:
@foreach($categories as $category)
@if($loop->first)
<ul>
@endif
<li><a href="{{ route('front.category.slug', $category->slug) }}">{{$category->name}}</a></li>
@if($loop->last)
</ul>
@endif
@endforeach
This provides a basic list of categories with a link to the category pages However it seems I modified the wrong pages because the css does not take effect and i can only see the changes in the homepage.
Also I can't seem to make it work for the sidebar menus in the category pages. Kindly assist me please.
@brandsafric What does this return? $categories = $this->categoryRepo->listCategories();
Can you dd()
it? Maybe you forgot to seed the data?
Hi @jsdecena I am trying to call the navigation for all the pages currently i am having it blank so I tried using $categories = $this->categoryRepo->listCategories();
however i manged to get it only on one page; the home page. can you kindly assist me? I am quite new to laravel. I can now see the pages already done in code that is category-nav.blade.php, category-sidebar-sub.blade.php and category-sub.blade.php, I am try to get the navigation to work but am finding difficulties. Thanks
Hi @jsdecena I am trying to call the navigation for all the pages currently i am having it blank so I tried using
$categories = $this->categoryRepo->listCategories();
however i manged to get it only on one page; the home page. can you kindly assist me? I am quite new to laravel. I can now see the pages already done in code that is category-nav.blade.php, category-sidebar-sub.blade.php and category-sub.blade.php, I am try to get the navigation to work but am finding difficulties. Thanks
You can use the global template service provider for that. https://github.com/jsdecena/laracom/blob/master/project/app/Providers/GlobalTemplateServiceProvider.php#L67
You see this part?
view()->composer(['layouts.front.category-nav'], function ($view) {
$view->with('categories', $this->getCategories());
});
you just need to import this layout: layouts.front.category-nav
or create another layout file and put it in the global template provider.
Okay, I checked resources/views/layouts/front/header-cart.blade.php and it seems that layout.front.category-nav
has already been imported. or am I suppose to import it in another page or file. please kindly indicate.
resources/views/layouts/front/header-cart.blade.php
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
@include('layouts.front.category-nav')
<ul class="nav navbar-nav navbar-right">
@if(auth()->check())
<li class="visible-xs"><a href="{{ route('accounts', ['tab' => 'profile']) }}"><i class="fa fa-home"></i> My Account</a></li>
<li class="visible-xs"><a href="{{ route('logout') }}"><i class="fa fa-sign-out"></i> Logout</a></li>
@else
<li class="visible-xs"><a href="{{ route('login') }}"> <i class="fa fa-lock"></i> Login</a></li>
<li class="visible-xs"><a href="{{ route('register') }}"> <i class="fa fa-sign-in"></i> Register</a></li>
@endif
<li id="cart" class="menubar-cart visible-xs">
<a href="{{ route('cart.index') }}" title="View Cart" class="awemenu-icon menu-shopping-cart">
<i class="fa fa-shopping-cart" aria-hidden="true"></i>
<span class="cart-number">{{ $cartCount }}</span>
</a>
</li>
<li>
<!-- search form -->
<form action="{{route('search.product')}}" method="GET" class="form-inline" style="margin: 15px 0 0;">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..." value="{!! request()->input('q') !!}">
<span class="input-group-btn">
<button type="submit" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i> Search</button>
</span>
</div>
</form>
<!-- /.search form -->
</li>
</ul>
</div><!-- /.navbar-collapse -->
Thanks
if that is in place, do you have the categories in your database?
please have a look at my hosted project here
here there is no navigation; http://kesselacosmetics.com/ and here there category sidebar is also not below the main menu http://kesselacosmetics.com/category/perfume
after the solution you provided i noticed the import of layouts.front.category-nav
has been made in layouts.front.header-cart
but nothing shows after i refresh the website
yes I see the categories in the database
@jsdecena Hello, so I noticed that all the code is intact however the main menu(category-nav) and the sidebars are still not working accordingly please assist
too old issue now. can't replicated
after installation the main navigation menu is not showing up and same for the sidebar menu in the category page. within the admin sector I do not see the payment method option as shown in images of the system. please kindly assist me as to how to fix it. Thank you. Regards