Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter agthalim

    (@agthalim)

    Hi,

    Thank you so much !! Indeed I just suppressed the maxzoom parameter, and it works fine. Sorry for missing that.

    Thread Starter agthalim

    (@agthalim)

    Thank you for this suggestion ; I’ll try it when I get more fluent with javascript !…

    Thread Starter agthalim

    (@agthalim)

    I don’t know why, it seems today that localization has returned in its original pannel !…

    Thread Starter agthalim

    (@agthalim)

    Hi, (never mind my last question), let me sum up things, and explain what I tried :

    What I want : a map and checkboxes corresponding to some custom taxonomy (let’s start with one) : the maps would show just the marks corresponding to the checked values of this taxonomy.

    So far I did two things :

    • added to the landing page checkboxes from which some javascript computes the shortcode which would correspond.
    • added to my landing page a custom field myShortcode in which there is the shortcode used by the template to display the map (using do_shortcode(), following your advice : thank you!)

      The original hope was to use the shortcode computed from the selected checkboxes to update the custom field and reload the page. But I cant’t find my way out of this. Would you have a suggestion ? Thank you in advance!
    Thread Starter agthalim

    (@agthalim)

    Thank you !

    Thread Starter agthalim

    (@agthalim)

    Dear Camille,

    Thanks for your great reactivity !

    Thank you for this answer. In effect, I had previously managed to use textual search, redefining search.php which used do_shortcode(…). But I need to build a page with checkboxes so that users can select the tax values they want to visualize.

    Here’s the dirty soution I come up with :

    • the global variable GLOBALS[myTheme][shortcode] is a string wirh the shortcode, initialized to show everything ;
    • when the page is loaded, do_shortcode(GLOBALS[myTheme][shortcode]), so that the page shows the map ;
    • with a javascript function, any click on a checkbox updates the shortcode sting in GLOBALS[myTheme][shortcode], and then opens the same url (so that the updated value of the global variable is used).

    Do you think such a solution would work ? Do you have any better suggestion ?

    What would be wrong with such a code as below ?

    $query = new WP_Query(
    array(
    'post_type' => 'post',
    'tax_query' => array(
    'relation' => 'OR',
    array ( 'taxonomy' => 'enjeu_environnemental', 'post_status' => array('publish'), 'field' => 'slug', 'terms' => array('nucleaire') ),
    array ( 'taxonomy' => 'pays', 'post_status' => array('publish'), 'field' => 'slug', 'terms' => array('algerie') ),

    array( 'taxonomy' => 'cttm-markers-tax', 'field' => 'name', 'terms' => 'hasmarker', ),
    ),
    )
    );

    Thank you again !

    Thread Starter agthalim

    (@agthalim)

    .

    Thread Starter agthalim

    (@agthalim)

    Would using get_posts with some relevant query as an argument be a solution ?…

    Thread Starter agthalim

    (@agthalim)

    Hello Camille,

    Thank you for this very interesting solution : using exerpts to display custom information corresponding to each marker. So far I wrote a function ‘texteHTMLPopover’ generating relevant things (title, one link to some other article whose id is in a custom field).

    Let me be more detailed for the whole structure : each article is either an ‘issue’ or a ‘creation’. I have a custom field (‘num_enjeu’), and if ‘creation’ $id is related so some ‘issue’ (which is described in article $numEnjeu) then then for the article $id, the custom field is $num_enjeu

    I can esasely get the ‘issue’ related to a given ‘creation’ :

    get_post_meta($id,'num_enjeu_situé',true)

    I’m having trouble getting a list of all ‘creations’ related to a given ‘issue’. I actually did this in the single.php page (probably a very unefficient solution) : the beginning of the single page fils some $GLOBALS table which keeps track of which is the article referred for each. For filling this table, I use two successive loops. And then I use it to list all ‘creations’ related to some ‘issue’.

    Now I tried to do the same thing inside the function which builds the exerpt, but it doesn’t work out.

    So I can’t find out a technical solution for getting the list of all articles which have some id in their custom field, in the exerpt.

    Can you suggest some way ?…

    Thread Starter agthalim

    (@agthalim)

    Hi Camille,
    Thank you for this fast and clear answer.
    Does the exerpt have to be at the beginning of the single.php page, or can I define it independently ?

    Thread Starter agthalim

    (@agthalim)

    Problem solved : I just used the shortcode inside my page (disable_clustering=true), rather than fiddling inside the code of the plugin.
    And it seems to work all right…

    Sorry !

    Thread Starter agthalim

    (@agthalim)

    The stuff is resolved !
    Thank you. Indeed the parameter

    current_query_markers=true

    did the job. It worked when I inserted it inside the search results template search.php :
    <?php echo do_shortcode( ‘ [travelers-map minzoom=3 current_query_markers=true width=100% height=100vh post_types=post,page tileurl=”https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png?access-token=…” subdomains=”abc” attribution=\’\’ title=”Tiles Courtesy of Jawg Maps” target=”_blank” ] ‘ );?>

    Thank you again !

    Thread Starter agthalim

    (@agthalim)

    Thank you for answering.
    However I tried straight to apply your answer, i.e. the page with search.php as model has this shortcode :

    [travelers-map current_query_markers=true minzoom=3 width=100% height=100vh post_types=post,page tileurl=”https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png?access-token=…” subdomains=”abc” attribution=’? <b>Jawg</b>Maps ? OpenStreetMap contributors’]

    But the page https://ecopoetique.huma-num.fr/?s=Assouan shows all markers, although it shows only a fex results.

    What did I miss ?…

    Thread Starter agthalim

    (@agthalim)

    Thank you Camille,
    It’s fixed now. I couldn’t find why, but I installed a nex underscore theme, and the traveler’s map extension works gloriously !

    Sorry for having unnecesarily disturbed.

    Thread Starter agthalim

    (@agthalim)

    Thank you for this instructive answer, Camille.
    Indeed I checked that header.php contains the line :

    <body <?php body_class(); ?>>

    ,
    and that footer.php contains the line :

    </body>

    So this was deleted from my template. Thanks for the explanation.

    However, the closing </div>’s did correspond to a div (class:”container-fluid”) and a div for a row (bootstrap stuff).

    It seems that unfortunately, the question seems related to the plugin itself : a page without a map, based on that template works (e.g. https://ecopoetique.huma-num.fr/2-2/)
    Pour info, here’s the template :

    `<?php
    /* The template TemplateAnthologieCartigraphiee.php, qui sert de page d’accueil pour le site ecopoetique
    /* Template Name: TemplateAnthologie_cartographiee */
    get_header();
    ?>
    <main id=”primary” class=”site-main”>
    <?php
    while ( have_posts() ) :
    the_post();
    get_template_part( ‘template-parts/content’, ‘page’ );

    // If comments are open or we have at least one comment, load up the comment template.
    if ( comments_open() || get_comments_number() ) :
    comments_template();
    endif;
    endwhile; // End of the loop.
    ?>
    </main><!– #main –>
    <?php
    get_sidebar();
    get_footer();
    ?>`

    `

    Now, if I just add the shortcode

    [travelers-map]

    , I get the ”…leafletJS files are missing.”
    So now I’m considering supressing the plugin and installing it again. But of course I’m terrified at the idea that I could lose data.

    Do you have a ny suggestion as to how to proceed ?
    Thank you !

    • This reply was modified 3 years ago by agthalim.
Viewing 15 replies - 1 through 15 (of 22 total)