Forum Replies Created

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

    (@adelaidelk)

    I finally got it to work. Here’s all the code in my custom pdb-single-custom.php page (except for the $exclude stmnt). I included the check for the edit_link field in the <?php while have_fields stmnt instead of in its own <?php stmnt, and I put the <?php $record = new PDb_Template($this); ?> right after the opening <div>.

    <div class="wrap <?php echo $this->wrap_class ?>">
    <?php $record = new PDb_Template($this); ?>
    
      <?php while ( $this->have_groups() ) : $this->the_group(); ?>
    
      <div class="section <?php $this->group->print_class() ?>" id="<?php echo Participants_Db::$prefix.$this->group->name ?>">
    
        <?php //$this->group->print_title( '<h2 class="pdb-group-title">', '</h2>' ) ?>
    
        <?php // $this->group->print_description() ?>
    
          <?php while ( $this->have_fields() ) : $this->the_field();
    	  /*
             * put the edit link URL into the link property of the field
             */
         if ($this->field->name == 'edit_link') {
              $this->field->link = $record->get_edit_link();
            }
           		   // skip any field found in the exclude array
              if ( in_array( $this->field->name, $exclude ) ) continue;
    
              // CSS class for empty fields
    					$empty_class = $this->get_empty_class( $this->field );
    
          ?>
    
        <dl class="<?php echo Participants_Db::$prefix.$this->field->name.' '.$this->field->form_element.' '.$empty_class?>">
    
          <dt class="<?php echo $this->field->name.' '.$empty_class?>"><?php $this->field->print_label() ?></dt>
    
          <dd class="<?php echo $this->field->name.' '.$empty_class?>"><?php $this->field->print_value() ?></dd>
    
        </dl>
    
        	<?php endwhile; // end of the fields loop ?>
          </div>
    
      <?php endwhile; // end of the groups loop ?>
    
    </div>

    Thread Starter adelaidelk

    (@adelaidelk)

    In the template itself I don’t know what to do: I want to display most of the fields and then the edit link. So all I want to do to customize the default single template is make the edit link active, to bring the user to the edit page for that record.

    Here’s what I have that’s not working:

    <div class="wrap <?php echo $this->wrap_class ?>">
    
      <?php while ( $this->have_groups() ) : $this->the_group(); ?>
    
      <div class="section <?php $this->group->print_class() ?>" id="<?php echo Participants_Db::$prefix.$this->group->name ?>">
    
      <?php /*?> <?php $this->group->print_title( '<h2 class="pdb-group-title">', '</h2>' ) ?><?php */?>
    
        <?php $this->group->print_description() ?>
          <?php $record = new PDb_Template($this); ?>
    
          <?php while ( $this->have_fields() ) : $this->the_field();?>
    
           <?php
            /*
             * put the edit link URL into the link property of the field
             */
            if ($this->field->name == 'edit_link') {
              $this->field->link = $record->get_edit_link();
            }
            $this->field->print_value();
            ?>

    here’s my shortcode:
    [pdb_single template=custom, fields="job_number, employer,job_type, practice_area, job_title, job_description, region,state,whats_new,date_posted,practice_area2, edit_link"]

    Thread Starter adelaidelk

    (@adelaidelk)

    I’ve done that and have it working on pdb_list page but it’s not working on pdb_single. When a single record is displayed I want to include a link to the edit page for that record.

    Thread Starter adelaidelk

    (@adelaidelk)

    Now I want to add the edit link to a page that uses the pdb_single shortcode to display a single record. Is this possible? I think I need to make changes to pdb-single.php but I don’t know exactly what or where.

    Thread Starter adelaidelk

    (@adelaidelk)

    Thanks. If that was in the doc anywhere I missed it, but all is working now.

    Thread Starter adelaidelk

    (@adelaidelk)

    So I added the Edit Record Link as described in the above article, and this time it all worked. But the link created just re-displays the list page instead of going to the edit page for that record.

    Here’s the url of the list page:
    /index.php/list-jobs-2/
    and the Edit link for one of the listed jobs is:
    /index.php/list-jobs-2/?pid=8IUTG

    The pid in the link for each job is different but clicking on it just redisplays the list page.

    My custom template is pdb-list-edit.php, I put it in the templates folder in my child-theme folder, and on the list page I used the shortcode [pdb_list template=edit]

    Thread Starter adelaidelk

    (@adelaidelk)

    I’m using a child theme and I couldn’t figure out where to put the custom template. I’ll keep working at it.

    Thread Starter adelaidelk

    (@adelaidelk)

    I tried that and couldn’t make it work. I’ll try again.

    I found the problem: the wp images folder wasn’t installed. Now all is working.

    I’m having a similar problem: When I try to a add a slide, the upload doesn’t work. So I added the images to my media library (and they’re there). But the Media Library tab is blank so I can’t select the images that way, and the search function doesn’t find any images either. All other plugins are deactivated and I have the same problem when I switch to the Twenty Twelve theme. Have I missed a step? I installed the plugin and proceeded directly to add slides.

    Thread Starter adelaidelk

    (@adelaidelk)

    Never mind!! Found the problem.

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