• Resolved abacus718

    (@abacus718)


    We’re using this lookup (love it, btw!) for a piece of Federal legislation, and I fear people will waste their time contacting their state senators/reps if they see them on the page. Is there any way to limit it to just federal? Thanks!

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ConstructiveGrowth

    (@constructivegrowth)

    Thank you for your kind words ??

    Yes, there is a way to limit the search to just federal congress people.
    Go to: Settings > CongressLookup > Custom Shortcode. In the first section it allows you to choose “Senators Only”, “Representatives Only, or “Both”. There are other customization you can also make. Save when done and it will generate a shortcode for the settings you’ve chosen. You can make and use multiple shortcodes throughout your site.

    Please let me know if you have any additional questions.

    Thread Starter abacus718

    (@abacus718)

    Hi, I tried that, but it gets me all senators (federal and state) or all reps (federal and state). I want only Federal, no state reps or senators.

    Plugin Author ConstructiveGrowth

    (@constructivegrowth)

    Oh, I’m sorry for my confusion. What you are wanting is not available with the current plugin. However, I have been working with my coder on a major update which will include this function. I have no ETA on when it will be complete.

    Thread Starter abacus718

    (@abacus718)

    Thanks. i’m trying to hack it in myself — will send you what I come up with. ??

    Thread Starter abacus718

    (@abacus718)

    It looks like CongressLookup.php uses the Google Civic API, but the getData.php uses the Sunlight API (which is what returns all the local etc). I’m using the Google Civic in another app and can limit it Federal — can you clarify which is being used in the plugin for the final data set?

    Plugin Author ConstructiveGrowth

    (@constructivegrowth)

    Hello @abacus718,

    We used to use the Sunlight API until it was discontinued almost 2 years ago. We now use the Google Civic API. It is true that the Google Civic API can return just Federal. I am working with my coder on a major update of the plugin which will include this feature. I have not current ETA on when it will be ready.

    Thread Starter abacus718

    (@abacus718)

    Ok great. I thought it was using Google – i just didn’t want to work on that to find out there was also Sunlight (which i was pretty sure was deprecated). Thanks for your quick responses!

    Thread Starter abacus718

    (@abacus718)

    Just in case anyone else needs it before the update, I ended up moving thing code that grabs the STATES for the returned data up just below
    foreach ($congress->officials as $c) {

    and then adding

    
    if($states[0]!='DC'){
    // (federal senators & reps have DC as their state
    
    $vis = 'hidden';
    } else {
    $vis = 'inline';
    }
    

    and then adding style=”visibility:$vis” to the h3 and ul tags to hide non-federal officials.

    It’s by no means pretty or perfect, but it’ll work in the short term.

    • This reply was modified 6 years, 4 months ago by abacus718.
    • This reply was modified 6 years, 4 months ago by abacus718.
    Plugin Author ConstructiveGrowth

    (@constructivegrowth)

    Thank you for sharing your solution, @abacus718!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘EXCLUDE state reps/senators’ is closed to new replies.