Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter bardo

    (@bardo)

    It works, thanks!

    For future reference, this is how to do it without touching the plugin:

    // Display a map if the wp-google-maps plugin is active
    if (function_exists('wpgmaps_user_javascript_basic')) {
      add_action('admin_footer', 'wpgmaps_user_javascript_basic');
      echo wpgmaps_tag_basic(array('id' => '1'));
    }
    Thread Starter bardo

    (@bardo)

    It works, thanks!

    For future reference, this is how to do it without touching the plugin:

    // Display a map if the wp-google-maps plugin is active
    if (function_exists('wpgmaps_user_javascript_basic')) {
      add_action('admin_footer', 'wpgmaps_user_javascript_basic');
      echo wpgmaps_tag_basic(array('id' => '1'));
    }
    Thread Starter bardo

    (@bardo)

    Yeah, I tried both with and without titleFromAlt to see if things changed and forgot to change it back. Anyway, I didn’t notice the empty title tag, I’ll check with the NGG dev… thanks a lot for your help!

    Thread Starter bardo

    (@bardo)

    Sure, here it is:

    <!-- Easy FancyBox 1.3.4.9 using FancyBox 1.3.4 - RavanH (http://4visions.nl/en/wordpress-plugins/easy-fancybox/) -->
    <script type="text/javascript">
    /* <![CDATA[ */
    jQuery(document).ready(function($){
    var fb_timeout = null;
    var fb_opts = { 'overlayShow' : true, 'width' : 600, 'height' : 470, 'centerOnScroll' : true, 'showCloseButton' : true, 'showNavArrows' : true, 'onCleanup' : function() { if(fb_timeout) { window.clearTimeout(fb_timeout); fb_timeout = null; } } };
    /* IMG */
    var fb_IMG_select = 'a[href$=".jpg"]:not(.nofancybox):not(:empty),a[href$=".JPG"]:not(.nofancybox):not(:empty)';
    $(fb_IMG_select).addClass('fancybox');
    var fb_IMG_sections = jQuery('article, div.hentry');
    fb_IMG_sections.each(function() { jQuery(this).find(fb_IMG_select).attr('rel', 'gallery-' + fb_IMG_sections.index(this)); });
    $('a.fancybox, area.fancybox').fancybox( $.extend({}, fb_opts, { 'transitionIn' : 'elastic', 'easingIn' : 'easeOutBack', 'transitionOut' : 'elastic', 'easingOut' : 'easeInBack', 'opacity' : false, 'titleShow' : true, 'titlePosition' : 'inside', 'titleFromAlt' : false }) );
    /* YouTube */
    $('a[href*="youtube.com/"]:not(.nofancybox):not(:empty)').addClass('fancybox-youtube');
    $('a[href*="youtu.be/"]:not(.nofancybox):not(:empty)').addClass('fancybox-youtube');
    $('a.fancybox-youtube, area.fancybox-youtube').fancybox( $.extend({}, fb_opts, { 'type' : 'iframe', 'width' : 640, 'height' : 385, 'padding' : 0, 'autoScale' : false, 'titleShow' : false, 'titlePosition' : 'float', 'titleFromAlt' : false, 'onStart' : function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/embed').replace(new RegExp('watch\\?v=([a-z0-9]+)(&|\\?)?(.*)', 'i'), 'embed/$1?version=3&$3') } }) );
    /* iFrame */
    $('a.fancybox-iframe, li.fancybox-iframe a, area.fancybox-iframe, li.fancybox-iframe a').fancybox( $.extend({}, fb_opts, { 'type' : 'iframe', 'width' : 800, 'padding' : 3, 'scrolling' : 'auto', 'autoScale' : false, 'titleShow' : false, 'titlePosition' : 'float', 'titleFromAlt' : false }) );
    /* Auto-click */
    $('#fancybox-auto').trigger('click');
    });
    /* ]]> */
    </script>
    
    <style type="text/css">.fancybox-hidden{display:none}</style>

    I noticed you have version “1.3.4.10”, I guess it’s a development version?

    Thread Starter bardo

    (@bardo)

    Hi RavanH, and thanks for answering.
    I’m sorry, but the site is not public yet, so I can’t send you a link. However, I can paste you some code.

    Here’s the thumbnail part:

    <div class="entry-content">
      <div id="ngg-gallery-13-409" class="ngg-galleryoverview">
        <div id="ngg-image-50" class="ngg-gallery-thumbnail-box">
          <div class="ngg-gallery-thumbnail">
            <a class="fancybox" rel="gallery-0" title=" "href="http://testsite.tld/wp-content/blogs.dir/3/files/my-gallery/image-01.jpg">
              <img width="100" height="75" src="http://testsite.tld/wp-content/blogs.dir/3/files/my-gallery/thumbs/thumbs_image-01.jpg" alt="Image title" title="Image title">
            </a>
          </div>
        </div>
      </div>
    </div>

    And here’s the part generated by easy-fancybox (note that the two plugins are configured to work together as described in the easy fancybox’ documentation, and they actually worked for a month or two in the same multisite environment):

    <div id="fancybox-wrap" style="display: block; width: 225px; height: auto; top: 145px; left: 499px;">
      <div id="fancybox-outer">
      <div id="fancybox-bg-n" class="fancybox-bg"></div>
      <div id="fancybox-bg-ne" class="fancybox-bg"></div>
      <div id="fancybox-bg-e" class="fancybox-bg"></div>
      <div id="fancybox-bg-se" class="fancybox-bg"></div>
      <div id="fancybox-bg-s" class="fancybox-bg"></div>
      <div id="fancybox-bg-sw" class="fancybox-bg"></div>
      <div id="fancybox-bg-w" class="fancybox-bg"></div>
      <div id="fancybox-bg-nw" class="fancybox-bg"></div>
      <div id="fancybox-content" style="border-width: 10px; width: 205px; height: 309px; opacity: 1;">
        <img id="fancybox-img" src="http://testsite.tld/wp-content/blogs.dir/3/files/my-gallery/image-01.jpg" alt=" ">
      </div>
      <a id="fancybox-close" style="display: inline;"></a>
      <a id="fancybox-left" href="javascript:;" style="display: none;">
        <span id="fancybox-left-ico" class="fancy-ico"></span>
      </a>
      <a id="fancybox-right" href="javascript:;" style="display: inline;">
        <span id="fancybox-right-ico" class="fancy-ico"></span>
      </a>
      <div id="fancybox-title" class="fancybox-title-inside" style="display: block; width: 205px; margin-left: 10px; margin-right: 10px;">
        <div id="fancybox-title-inside"> </div>
      </div>
    </div>

    As you can see, the interesting part is near the end: the “fancybox-title” div is totally empty. Changing the title positioning just changes its subdiv id (which in this case is “fancybox-title-inside”) and nothing else. Notice how, in the first block of code, “title” and “alt” are correctly set…

    Thread Starter bardo

    (@bardo)

    Additional info that could be useful: descriptions are printed fine, only titles are missing.

    Thread Starter bardo

    (@bardo)

    Seems great, thanks! I didn’t think custom fields could be processed that way… Thanks a lot, the example is really clear 🙂

    Thread Starter bardo

    (@bardo)

    Thanks for answering, Jackson.

    I’m thinking more of the second kind, something like, for example:

    Content template -> “Product page”

    Fields to fill: product name (inserted in an <h1> tag, prepended by a “Buy: ” string), product description (will end up in a <div> with a specific id or class), technical specs (comma/newline separated, will end up in a list with its own id/class…).

    Use case: the user selects the content template thingy and gets a form to fill, or at least a normal page editor screen, but pre-filled with sample data defined in the template.

    That’s how I visualize it, it should not necessarily be this way, I just want to get the point across… is it clearer now?

    Thread Starter bardo

    (@bardo)

    If you can, it’d be very nice of you 🙂 Thanks a lot for answering!

    Thread Starter bardo

    (@bardo)

    I did, and I found two major drawbacks: they would need html code to be directly input, and since they are not made for this, an entire paragraph would have to be put inside the field. This is not ideal to deal with non-technical users, it would complicate the matter even more.

    Thread Starter bardo

    (@bardo)

    Because custom templates are related to the structure of a page, not to its contents. I’m looking for content templates.

Viewing 11 replies - 1 through 11 (of 11 total)