• I understand on how to submit a form as post. I can also select certain form data (labels and items) to be displayed. But this only applies to posting a Page by using slug. If I post 10 Pages I should insert the slug 10 times. I would like certain labels and items to be displayed in Recent Post. So, when my students submit a form, the data in selected label-item will be displayed in Recent Post. I got headache in tweaking the code of custom template. I tried the following code but with no luck: I have 10 labels, the results are each label with item (title, author, abstract) appear 10 times (total: 30). Unselected labels disappear.

    <ul id="fm-summary-multi">
    <?php while(fm_summary_have_items()): fm_summary_the_item(); ?>
    	<?php if(fm_summary_the_type() == 'separator'): ?>
    		<hr />
    	<?php elseif(fm_summary_has_data()): ?>
    		<li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('title');?>: <strong><?php echo fm_summary_get_item_value('title');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('author');?>: <strong><?php echo fm_summary_get_item_value('author');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('abstract');?>: <strong><?php echo fm_summary_get_item_value('abstract');?></strong>
    
    	<?php endif; ?>
    <?php endwhile; ?>
    
    <hr />

    I also tried to remove the following code in the second and third selected label-item (author, abstract) but the result are the same (=30 label-item).

    <?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>

    Please help me.

    http://wordpress.org/extend/plugins/wordpress-form-manager/

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mrengezh

    (@mrengezh)

    I tried to search this forum and my question in substance is similar to many questions raised by other members whose questions are unanswered, i.e. what is the code of custom template to hide or to select certain labels-items? Using a slug is just for a manual posting by admin/moderstor. For automatic posting by web visitor or members who fill the form this slug trick cannot be applied.

    Since no one can resolve this issue by suggesting a workable code, we should try another alternative. I have an idea for concerned members to hunt any other pluggins on custom recent posts where we can insert slug or shortcode. Kindly please inform me/us if anyone has already find it. Thanks in advance.

    i don’t understand what you are trying to accomplish here. Can you re-explain?

    Thread Starter mrengezh

    (@mrengezh)

    Sorry for late reply. I would like to publish submissions as posts so that they will appear in Recent Posts [in fresh install of wp, we will find it]. But I want to hide certain label-value in such recent posts. Hope you could help. Thanks in advance.

    i’m still a little unsure as to what you are looking to make happen, but looking at your code above, can you remove the while statement to keep from getting the multi-display of values? Thus …

    <ul id="fm-summary-multi">
    <?php echo fm_summary_get_item_label('title');?>: <strong><?php echo fm_summary_get_item_value('title');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('author');?>: <strong><?php echo fm_summary_get_item_value('author');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('abstract');?>: <strong><?php echo fm_summary_get_item_value('abstract');?></strong>
    </ul>
    
    <hr />
    Thread Starter mrengezh

    (@mrengezh)

    It works. Now I can hide or select certain label-value in Recent Post. But I have new problems: First: The label still appears although I don’t fill it with data/value (I already tick “Hide empty fields in summaries”). Second, link to the file doesn’t work.

    Let me summarize. I use this code:

    <ul id="fm-summary-multi">
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('title');?>: <strong><?php echo fm_summary_get_item_value('title');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('author');?>: <strong><?php echo fm_summary_get_item_value('author');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('abstract');?>: <strong><?php echo fm_summary_get_item_value('abstract');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('docfile');?>: <strong><?php echo fm_summary_get_item_value('docfile');?></strong>
    
    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('pdffile');?>: <strong><?php echo fm_summary_get_item_value('pdffile');?></strong>
    </ul>

    I want to hide label-value of .doc file (e.g. test.doc) in recent post but can still access it in the database. So, I remove the following code:

    <li<?php if(fm_summary_the_nickname() != "") echo " id=\"fm-item-".fm_summary_the_nickname()."\"";?>><?php echo fm_summary_get_item_label('docfile');?>: <strong><?php echo fm_summary_get_item_value('docfile');?></strong>

    The result is: The label-value of test.doc file disappear in recent post but I can still access it in Download data (.csv). This is what I want. Nevertheless, for PDF file, there is no link to the PDF file in the recent post. It appears as follows:

    a:5:{s:8:"filename";s:28:"test (12-12-12-10-12-15).pdf";s:8:"contents";s:0:"";s:10:"upload_dir";b:1;s:10:"upload_url";s:66:"http://mysite.com/wp-content/uploads/2012/12/";s:4:"size";i:17265;}

    So, how to solve those two remaining problems: hiding empty fields and link to the file?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Submit form in Recent Post’ is closed to new replies.