• Resolved aapopei

    (@aapopei)


    Hello there, how can I achieve the same uniqName in the case of zcomparisonpath?

    For example I have multiple zoomify containers on the same page. For each I use a ‘null’ on file because I don’t use the direct .zif file, but instead I use a .xml file via zcomparisonpath (the .xml contain absolute path for 2 .zif files).

    Everything works great with one container if I will use file=’null’. I mention that I modified your version, in order to use the zcomparisonpath function.

    So, I’ve tried to change the following rows:

    	$filePathComp = $a['zcomparisonpath'];
    	$fileNameComp = substr($filePathComp, strrpos($filePathComp, '/') + 1);
    	$uniqNameComp = 'zoomifyContainer-' . strtolower(str_replace('.xml', '', $fileNameComp));
    	unset($a['zcomparisonpath']);
    
    	$output = zoomify_container_js($filePathComp, $a, $uniqNameComp);
    	
    	$output .= "<div id='{$uniqNameComp}' class='zoomify-wrapper'></div>";
    
    	return $output;

    But doesn’t work.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author SdeWijs

    (@sdewijs)

    Hi,

    The plugin currently only supports one direct .zif file link per container.

    But if you send me an example if the XML file, perhaps I can start support for this feature in an upcoming release. Can you explain how the zcomparisonpath parameter determines the source of the zif?

    Regards,
    Sander

    • This reply was modified 6 years ago by SdeWijs.
    Plugin Author SdeWijs

    (@sdewijs)

    Hey,

    I took a closer look at your issue. The issue is that the name of the container is created by the name of the zif file. I think I can fix that by adding an additional parameter to name the container, in case the filename is null.

    Will look into this the coming week.

    Regards,
    Sander

    Thread Starter aapopei

    (@aapopei)

    I want to put multiple containers like the following code in WP:

    [zoomify file="null" zComparisonPath="linktomy.xml" zUnitsPerImage="45" zNavigatorRectangleColor="ff0000" zInitialZoom="fill"]

    I mention that some option functions I easily added to the list (for PRO version).

    I think that zComparisonPath option is supported only in PRO version.

    Example of my .xml file (according to zoomify example)

    <COMPARISONDATA>
    	<SETUP
    		SYNCVISIBLE="1"
    		INITIALSYNC="1" >
    	</SETUP>
    	<IMAGE
    		MEDIA="linktomzif1.zif"
    		NAME=""
    		INITIALX=""
    		INITIALY=""
    		INITIALZOOM="-1" 
    		MINZOOM="-1"
    		MAXZOOM="100" >
    	</IMAGE>
    	<IMAGE
    		MEDIA="linktomzif2.zif"
    		NAME=""
    		INITIALX=""
    		INITIALY=""
    		INITIALZOOM="-1" 
    		MINZOOM="-1"
    		MAXZOOM="100" >
    	</IMAGE>
    </COMPARISONDATA>

    Thanks for your time & knowledge!

    Thread Starter aapopei

    (@aapopei)

    So what I want is to have something like this on a page:

    <!-- container 1 -->
    [zoomify file="null" zComparisonPath="linktomy1.xml" zUnitsPerImage="45" zNavigatorRectangleColor="ff0000" zInitialZoom="fill"]
    <!-- container 2 -->
    [zoomify file="null" zComparisonPath="linktomy2.xml" zUnitsPerImage="45" zNavigatorRectangleColor="ff0000" zInitialZoom="fill"]

    Without any intervention regarding the unique container name made by you, only 1 container is shown. I think that is related to the “file” option.

    Thread Starter aapopei

    (@aapopei)

    Dear Sander,

    Thank you for your suggestion and I’m waiting for your fix.

    Best regards,
    Andrei

    Thread Starter aapopei

    (@aapopei)

    Dear Sander,

    Sorry for the inconvenience and insistence :).

    I’ve added the following code in gh_zoomify_shortcode function:

    after: unset($a[‘file’]);

    $filePathComp = $a['zcomparisonpath'];
    $fileNameComp = substr($filePathComp, strrpos($filePathComp, '/') + 1);
    $uniqNameComp = '-' . strtolower(str_replace('.xml', '', $fileNameComp));
    unset($a['zcomparisonpath']);
    $uniqName .= $uniqNameComp;

    and before $output = zoomify_container_js($filePath, $a, $uniqName);

    Also, I have changed accordingly the following row in zoomify_container_js function (added variable $test to increment):

    $output = '<script type="text/javascript">Z.showImage("' . $containerName . $test .'", "' . $linkToFile . '", "zSkinPath=' . $zSkinPath;

    Now I have two containers with different id containers:

    Z.showImage("zoomifyContainer-ull-granite_2", "null");
    <div id="zoomifyContainer-ull-granite_2" class="zoomify-wrapper"></div>

    and

    Z.showImage("zoomifyContainer-ull-granite_2", "null");
    <div id="zoomifyContainer-ull-granite_2" class="zoomify-wrapper"></div>

    I got the following error:

    viewz.js?ver=1.0:24994 Uncaught TypeError: Cannot read property 'currentStyle' of null
        at Object.getElementStyle (viewz.js?ver=1.0:24994)
        at new Z.ZoomifyImageViewer (viewz.js?ver=1.0:202)
        at Object.Z.createViewer (viewz.js?ver=1.0:170)
        at Object.Z.initialize (viewz.js?ver=1.0:160)
        at Object.Z.showImage (viewz.js?ver=1.0:135)
        at (index):746
    getElementStyle	@	viewz.js?ver=1.0:24994
    Z.ZoomifyImageViewer	@	viewz.js?ver=1.0:202
    Z.createViewer	@	viewz.js?ver=1.0:170
    Z.initialize	@	viewz.js?ver=1.0:160
    Z.showImage	@	viewz.js?ver=1.0:135
    (anonymous)	@	(index):746

    What I suspect is that the zcomparisonpath option is no longer generated (missing from the inspect JavaScript/HTML).
    I will investigate more…

    Andrei

    Plugin Author SdeWijs

    (@sdewijs)

    Hi Andrei,

    In the example it looks like you only need one container for 2 images. The idea is to show them side-by-side right? http://www.zoomify.com/ZV5/36-Comparison.htm

    Thread Starter aapopei

    (@aapopei)

    Hi again,

    Indeed, but I want multiple containers with comparison feature on the same page. I mention that ComparisonList is not what I want.

    Thread Starter aapopei

    (@aapopei)

    Dear Sander,
    I hope that you’re ok. You tried to add an additional parameter to name the container (in case of the filename == null).

    Andrei

    Plugin Author SdeWijs

    (@sdewijs)

    Hi Andrei,

    I did some more debugging and it looks like the zComparisonPath XML, as I read it in the Zoomify docs, does not work with .zif files. In the example, the xml only references the directories with the image tiles.

    In the next update the zcomparisonpath parameter is included. So if you upload the image tile directories manually, you can reference both directories in the XML and this should work.

    Also, I fixed the unique container name in case the file is null (in case of the zComparisonPath option)

    Regards,
    Sander

    • This reply was modified 5 years, 8 months ago by SdeWijs.
Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Create unique zoomifyContainer for zcomparisonpath’ is closed to new replies.