added multi lang items into sitemap

master
A1Gard 1 month ago
parent b583f31627
commit 2bb6bf6931

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <? xml version = "1.0" encoding = "utf-8" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@if(\App\Models\Product::count() > 0) @if(\App\Models\Product::count() > 0)
@ -93,97 +93,99 @@
@endforeach @endforeach
@if(config('app.xlang.active')) @if(config('app.xlang.active'))
@foreach(\App\Models\XLang::where('is_default',0)->pluck('tag')->toArray() as $lang) @foreach(\App\Models\XLang::where('is_default',0)->pluck('tag')->toArray() as $lang)
{{-- WIP multi lang --}}
{{-- @if(\App\Models\Product::count() > 0)--}} @php(app()->setLocale($lang))
@if(\App\Models\Product::count() > 0)
{{-- <url>--}}
{{-- <loc>{{route('client.products')}}</loc>--}} <url>
{{-- <lastmod>{{\App\Models\Product::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <loc>{{route('client.products')}}/{{$lang}}</loc>
{{-- <changefreq>daily</changefreq>--}} <lastmod>{{\App\Models\Product::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- <priority>1</priority>--}} <changefreq>daily</changefreq>
{{-- </url>--}} <priority>1</priority>
{{-- @endif--}} </url>
{{-- @if(\App\Models\Post::count() > 0)--}} @endif
@if(\App\Models\Post::count() > 0)
{{-- <url>--}}
{{-- <loc>{{route('client.posts')}}</loc>--}} <url>
{{-- <lastmod>{{\App\Models\Post::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <loc>{{route('client.posts')}}/{{$lang}}</loc>
{{-- <changefreq>weekly</changefreq>--}} <lastmod>{{\App\Models\Post::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- <priority>1</priority>--}} <changefreq>weekly</changefreq>
{{-- </url>--}} <priority>1</priority>
{{-- @endif--}} </url>
{{-- @if(\App\Models\Gallery::count() > 0)--}}
@endif
{{-- <url>--}} @if(\App\Models\Gallery::count() > 0)
{{-- <loc>{{route('client.galleries')}}</loc>--}}
{{-- <lastmod>{{\App\Models\Gallery::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{route('client.galleries')}}/{{$lang}}</loc>
{{-- <priority>2</priority>--}} <lastmod>{{\App\Models\Gallery::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endif--}} <priority>2</priority>
{{-- @if(\App\Models\Attachment::count() > 0)--}} </url>
@endif
{{-- <url>--}} @if(\App\Models\Attachment::count() > 0)
{{-- <loc>{{route('client.attachments')}}</loc>--}}
{{-- <lastmod>{{\App\Models\Attachment::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{route('client.attachments')}}/{{$lang}}</loc>
{{-- <priority>2</priority>--}} <lastmod>{{\App\Models\Attachment::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endif--}} <priority>2</priority>
{{-- @if(\App\Models\Clip::count() > 0)--}} </url>
@endif
{{-- <url>--}} @if(\App\Models\Clip::count() > 0)
{{-- <loc>{{route('client.clips')}}</loc>--}}
{{-- <lastmod>{{\App\Models\Clip::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{route('client.clips')}}/{{$lang}}</loc>
{{-- <priority>2</priority>--}} <lastmod>{{\App\Models\Clip::orderByDesc('updated_at')->first()->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endif--}} <priority>2</priority>
{{-- @foreach(\App\Models\Product::where('status',1)->orderBy('id')->get(['slug','updated_at']) as $item)--}} </url>
@endif
{{-- <url>--}} @foreach(\App\Models\Product::where('status',1)->whereLocale('name',$lang)->orderBy('id')->get(['slug','updated_at','name']) as $item)
{{-- <loc>{{route('client.product',$item->slug)}}</loc>--}}
{{-- <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{$item->webUrl()}}</loc>
{{-- <priority>3</priority>--}} <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endforeach--}} <priority>3</priority>
{{-- @foreach(\App\Models\Post::where('status',1)->orderBy('id')->get(['slug','updated_at']) as $item)--}} </url>
@endforeach
{{-- <url>--}} @foreach(\App\Models\Post::where('status',1)->whereLocale('title',$lang)->orderBy('id')->get(['slug','updated_at','title']) as $item)
{{-- <loc>{{route('client.post',$item->slug)}}</loc>--}}
{{-- <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{$item->webUrl()}}</loc>
{{-- <priority>3</priority>--}} <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endforeach--}} <priority>3</priority>
{{-- @foreach(\App\Models\Clip::where('status',1)->orderBy('id')->get(['slug','updated_at']) as $item)--}} </url>
@endforeach
{{-- <url>--}} @foreach(\App\Models\Clip::where('status',1)->whereLocale('title',$lang)->orderBy('id')->get(['slug','updated_at','title']) as $item)
{{-- <loc>{{route('client.clip',$item->slug)}}</loc>--}}
{{-- <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{$item->webUrl()}}</loc>
{{-- <priority>3</priority>--}} <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endforeach--}} <priority>3</priority>
{{-- @foreach(\App\Models\Gallery::where('status',1)->orderBy('id')->get(['slug','updated_at']) as $item)--}} </url>
@endforeach
{{-- <url>--}} @foreach(\App\Models\Gallery::where('status',1)->whereLocale('title',$lang)->orderBy('id')->get(['slug','updated_at','title']) as $item)
{{-- <loc>{{route('client.gallery',$item->slug)}}</loc>--}}
{{-- <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{$item->webUrl()}}</loc>
{{-- <priority>3</priority>--}} <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endforeach--}} <priority>3</priority>
{{-- @foreach(\App\Models\Attachment::where('is_fillable',1)->orderBy('id')->get(['slug','updated_at']) as $item)--}} </url>
@endforeach
{{-- <url>--}} @foreach(\App\Models\Attachment::where('is_fillable',1)->whereLocale('title',$lang)->orderBy('id')->get(['slug','updated_at','title']) as $item)
{{-- <loc>{{route('client.attachment',$item->slug)}}</loc>--}}
{{-- <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>--}} <url>
{{-- <changefreq>weekly</changefreq>--}} <loc>{{$item->webUrl()}}</loc>
{{-- <priority>3</priority>--}} <lastmod>{{$item->updated_at->tz('UTC')->toAtomString()}}</lastmod>
{{-- </url>--}} <changefreq>weekly</changefreq>
{{-- @endforeach--}} <priority>3</priority>
</url>
@endforeach
@endforeach @endforeach
@endif @endif

Loading…
Cancel
Save