WordPress.org

Ready to get started?Download WordPress

Forums

WP LinkedIn
[resolved] Volunteer Experience (10 posts)

  1. maychookmusic
    Member
    Posted 11 months ago #

    Hi there, the plugin works great but I wanted to add volunteer experience to my profile. I added the field "volunteer" in my plugin setting page. I don't know much about php but I tried to add some codes to the customized template (already copied the template to a new "linkedin" folder in my theme folder), obviously it didn't work. now the code is sitting in my template and my website doesn't show any volunteer experience.

    This is the code that I tweaked around.

    <?php if (isset($profile->volunteer->values) && is_array($profile->volunteer->values)): ?>
    <div id="volunteer" class="section">
    <div class="heading"><?php _e('Volunteer Experience', 'wp-linkedin'); ?></div>
    <?php foreach ($profile->role->values as $v): ?>
    <div class="volunteer">
    <div class="role"><?php echo $v->role; ?> (<?php echo $v->startDate->year; ?> - <?php echo isset($v->endDate) ? $v->endDate->year : __('Present', 'wp-linkedin'); ?>)</div>
    <div class="organization"><?php echo $v->organization->name; ?></div>
    <?php if (isset($v->cause)): ?>
    <div class="cause"><?php echo nl2br($v->cause); ?></div>
    <?php endif; ?>
    </div>
    <?php endforeach; ?>
    </div>
    <?php endif; ?>

    Here is my website if you would like to take a look. http://www.maychook.com/cv/

    Thanks!

    http://wordpress.org/plugins/wp-linkedin/

  2. Claude Vedovini
    Member
    Plugin Author

    Posted 11 months ago #

    Hi May,
    The main problem I see with the code you posted is that line:

    <?php foreach ($profile->role->values as $v): ?>

    I think it should be:

    <?php foreach ($profile->volunteer->values as $v): ?>

    I also recommend you use var_dump($profile)do see exactly how it looks likes because sometime the name of the fields are not what is advertised in the doc and this one could be volunteerExperience instead of just volunteer

  3. Claude Vedovini
    Member
    Plugin Author

    Posted 11 months ago #

    Hi May,

    Did you make this work? If yes I would be interest in integrating that part you developed in the standard templates if you agree :)

    Regards,
    C.

  4. maychookmusic
    Member
    Posted 11 months ago #

    Hi Claude,

    Unfortunately it didn't work. I tried changing from "role" to "volunteer", nothing changed. I used var_dump($profile) and this is what I got..showing you 2 examples (since it's a long list)

    ["volunteerExperiences"]=>
        object(stdClass)#18 (2) {
          ["_total"]=>
          int(6)
          ["values"]=>
          array(6) {
            [0]=>
            object(stdClass)#5 (3) {
              ["id"]=>
              int(64)
              ["organization"]=>
              object(stdClass)#356 (1) {
                ["name"]=>
                string(41) "North York Arts (Toronto Arts Foundation)"
              }
              ["role"]=>
              string(49) "Assistant Volunteer Coordinator & Info Ambassador"
            }
            [1]=>
            object(stdClass)#357 (3) {
              ["id"]=>
              int(65)
              ["organization"]=>
              object(stdClass)#358 (1) {
                ["name"]=>
                string(41) "Multiple arts organizations and festivals"
              }
              ["role"]=>
              string(23) "Assistant Stage Manager"
            }
    
    I made some minor changes and nothing changed on my page. 
    
    <?php if (isset($profile->volunteerExperiences->values) && is_array($profile->volunteerExperiences->values)): ?>
    <div id="volunteer" class="section">
    <div class="heading"><?php _e('Volunteer Experience', 'wp-linkedin'); ?></div>
    <?php foreach ($profile->volunteer->values as $v): ?>
    <div class="volunteer">
    <div class="role"><?php echo $v->role; ?> (<?php echo $v->startDate->year; ?> - <?php echo isset($v->endDate) ? $v->endDate->year : __('Present', 'wp-linkedin'); ?>)</div>
    <div class="organization"><?php echo $v->organization->name; ?></div>
    <?php if (isset($v->cause)): ?>
    <div class="cause"><?php echo nl2br($v->cause); ?></div>
    <?php endif; ?>
    </div>
    <?php endforeach; ?>
    </div>
    <?php endif; ?>

    It would be great to add volunteer field to the standard template if things work out.

  5. Claude Vedovini
    Member
    Plugin Author

    Posted 11 months ago #

    what's the list of fields you configured in the settings?

  6. maychookmusic
    Member
    Posted 11 months ago #

    positions, skills, educations, languages, volunteer

  7. Claude Vedovini
    Member
    Plugin Author

    Posted 11 months ago #

    Hi, it's much complex than expected...
    Here's the code you need to put in the template:

    <?php if (isset($profile->volunteer->volunteerExperiences->values) && is_array($profile->volunteer->volunteerExperiences->values)): ?>
    <div id="volunteer-experiences" class="section">
    	<div class="heading"><?php _e('Volunteer Experiences', 'wp-linkedin'); ?></div>
    	<?php foreach ($profile->volunteer->volunteerExperiences->values as $v): ?>
    	<div class="volunteer">
    		<div class="role"><?php echo $v->role; ?> (<?php echo $v->startDate->year; ?> - <?php echo isset($v->endDate) ? $v->endDate->year : __('Present', 'wp-linkedin'); ?>)</div>
    		<div class="organization"><?php echo $v->organization->name; ?></div>
    		<?php if (isset($v->cause)): ?>
    		<div class="cause"><?php echo $v->cause->name; ?></div>
    		<?php endif; ?>
    	</div>
    	<?php endforeach; ?>
    </div>
    <?php endif; ?>

    and here's what you need to add to the list of fields:

    volunteer:(volunteer-experiences:(organization,cause,role,start-date,end-date))

    HTH

  8. maychookmusic
    Member
    Posted 11 months ago #

    Hi, it works now but it doesn't have formatting. It looks like this:-

    Assistant Volunteer Coordinator & Info Ambassador (2013 - Present)
    North York Arts (Toronto Arts Foundation)
    artsAndCulture
    Assistant Stage Manager (2010 - 2013)
    Multiple arts organizations and festivals
    artsAndCulture
    Installation Assistant (2011 - 2013)
    Multiple exhibits
    artsAndCulture
    Front of House Volunteer (2011 - 2011)
    The Canadian Stage Company
    artsAndCulture
    Peer Mentor - Faculty of Fine Arts & York International (2010 - 2012)
    York University
    education
    Student Ambassador (2010 - 2010)
    York University
    education

    Also, would it be possible to include the summary of each role? Thank you.

  9. Claude Vedovini
    Member
    Plugin Author

    Posted 11 months ago #

    For the formatting you must tweak your theme's CSS, for the summary you must add the description field in the list and output it in the template.

    Or you just wait for version 1.6 of the plugin since I'll be adding that to the template and CSS (not to the field list tho)

  10. maychookmusic
    Member
    Posted 10 months ago #

    Okay, that's good. I added description and formatting by myself for now. Thank you for your help.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.