How to use a new gallery in the image field ?

1 month 4 weeks ago #79351 by lclaude
Hello,

Thanks, that's cool !

I have add a display: inline-flex; style, in the .php:
<div id="panorama_' . $uniqueid . '" style="width: ' . $w . 'px; height: ' . $w . 'px; max-width: 100%; max-height: ' . $vp_max_height  . 'vh; display: inline-flex;"></div>

I have change the 'title' variable, and added 'author', like this :
"title": "' . $desc_encoded . '",
"author": "' . $title_encoded .'",

And add 3 variables, for Pannellum features:
$Pannellum_autoRotate                 = (int) $field->parameters->get( $PPFX_ . 'autoRotate', 3 );
$Pannellum_orientationOnByDefault     = (int) $field->parameters->get( $PPFX_ . 'orientationOnByDefault', 1 );
$Pannellum_showZoomCtrl               = (string) $field->parameters->get( $PPFX_ . 'showZoomCtrl', 'true' );

So, the 'script' section become :
<div id="panorama_' . $uniqueid . '" style="width: ' . $w . 'px; height: ' . $w . 'px; max-width: 100%; max-height: ' . $vp_max_height  . 'vh; display: inline-flex;"></div>
	<script>
		pannellum.viewer(\'panorama_' . $uniqueid . '\', {
			"type": "equirectangular",
			"panorama": "' . JUri::root(true).'/'.$srco . '",
			"preview": "' . $ABS_SRC . '",
			"title": "' . $desc_encoded . '",
			"author": "' . $title_encoded .'",
                        "autoRotate": "' . $Pannellum_autoRotate .'",
                        "orientationOnByDefault": "' . $Pannellum_orientationOnByDefault . '",
                        "showZoomCtrl": "' . $Pannellum_showZoomCtrl . '"
		});
	</script>


And in the .xml:
			<field name="" type="separator" default="Pannellum options" level="level1" />
 
			<field name="Pannellum_autoRotate" type="number" default="-5" label="Autorotate (°/s)" description="Setting this parameter causes the panorama to automatically rotate when loaded. The value specifies the rotation speed in degrees per second. Positive is counter-clockwise, and negative is clockwise" />
 
			<field name="Pannellum_orientationOnByDefault" type="multilist" subtype="radio" default="1" toggle_related="1" label="Device orientation" description="If set to true, device orientation control will be used when the panorama is loaded, if the device supports it. If false, device orientation control needs to be activated by pressing a button." class="btn-group btn-group-yesno" depend_class="">
				<option value="0">FLEXI_NO</option>
				<option value="1">FLEXI_YES</option>
			</field>
 
			<field name="Pannellum_showZoomCtrl" type="multilist" subtype="radio" default="true" toggle_related="1" label="Show zoom controls" description="If set to false, the zoom controls will not be displayed." class="btn-group btn-group-yesno" depend_class="">
				<option value="0">FLEXI_NO</option>
				<option value="true">FLEXI_YES</option>
			</field>

Laurent

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.