Add Shortcode Slider, 505 Result

Laraship QuestionsCategory: TechnicalAdd Shortcode Slider, 505 Result
Arif Hidyawan asked 6 years ago

Hi, how to display shortcode slider in php script?

I try to write {!! Shortcode::compile( ‘slider’, {slidehome} ) !!} or @slider(slidehome)

but It’s says “500 Sorry, Something went wrong!”

2 Answers
laraship Staff answered 6 years ago

Hello,

It should be :

{!! Shortcode::compile( 'slider', 'slidehome' ) !!}

where slidehome is your sider key

Arif Hidyawan answered 6 years ago

laravel.log

[2018-06-30 08:51:39] local.ERROR: Undefined variable: slider_key (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) {"userId":1,"email":"webmaster@propami.com","exception":"[object] (ErrorException(code: 0): Undefined variable: slider_key (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) at /var/www/html/storage/framework/views/c3149f9551017e18acbbe9405d6d0105c849e861.php:56, ErrorException(code: 0): Undefined variable: slider_key (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) at /var/www/html/storage/framework/views/c3149f9551017e18acbbe9405d6d0105c849e861.php:56, ErrorException(code: 0): Undefined variable: slider_key (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) at /var/www/html/storage/framework/views/c3149f9551017e18acbbe9405d6d0105c849e861.php:56, ErrorException(code: 0): Undefined variable: slider_key (View: /var/www/html/Corals/modules/Slider/resources/views/sliders/slider.blade.php) at /var/www/html/storage/framework/views/c3149f9551017e18acbbe9405d6d0105c849e861.php:56, ErrorException(code: 0): Undefined variable: slider_key at /var/www/html/storage/framework/views/c3149f9551017e18acbbe9405d6d0105c849e861.php:56)