Jump to content

Archived

This topic is now archived and is closed to further replies.

brightonkeller

Using Custom Fields to Create Custom Page Template

Recommended Posts

brightonkeller

Ok so there are 2 issues I'm having. 

 

1. Create custom PAGE template by pulling "custom fields" from post loop

 

2. Successfully being able to CHOOSE this page template when using the dropdown template selector in page creation admin

 

Ok so let me first address Problem 1 by explaining what I am trying to do.

 

To better illustrate, I have marked up a screenshot from a website with similar idea. This page "template" shown in the screenshot below is basically like a customized postloop. Where it pulls certain parts of the post into summary form. Instead of, say, pulling the "excerpt", I want to pull 2 custom fields in addition to the featured image. Here is how I want it to (kind of) look.

 

https://www.dropbox.com/s/r295ju0eri9nyhv/showing-different-sections-of-template.png?dl=0

 

And I plan on creating these "custom fields" by using the Advanced custom Fields plugin - see screen shot showing how it adds a WYSIWYG section for the custom field below the normal content:

 

https://www.dropbox.com/s/v1s3326o8ze4zd9/showing-how-advanced-custom-filter-helps.png?dl=0

 

So I think the best way to do this would be to create a custom page template. 

 

Additionally, if I wanted to edit the layout/look of the default DMS2 postloop format (class = "pl-new-loop") via FTP how would I do that? To be more specific, instead of putting the EXCERPT below the blow title and meta data (under featured image like default), what if I wanted to add one of my custom field types as described above? Would I do this via hook? If so, which one and how?

 

Now onto Problem 2. 

 

I create a page template in my directory in my skeleton child theme. See Screenshot of FTP here:

 

https://www.dropbox.com/s/mn5w6lyd2ut9c5d/Screenshot%202015-01-20%2022.42.36.png?dl=0

 

But when I go to the dropdown to select the template, it is not available. See screen shot here:

 

https://www.dropbox.com/s/x4b509ux4178qzh/template-not-showing-up.png?dl=0

Share this post


Link to post
Share on other sites
Danny

Hi,

 

1. I am going to have to assume what you're trying to achieve as the screenshots are giving a 404. Basically, if you want to display custom fields in a postloop you're going to need to use advanced custom code and/or build your own section. This isn't something we can provide support for unfortunately.

 

2. You can not create templates like that in DMS, as they're not supported. DMS creates the templates for you.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
brightonkeller

that's such a bummer that I can't create custom template ;( is there any way around it? 

 

how do i build my own section? where is documentation? the basic documentation is super skimpy....

Share this post


Link to post
Share on other sites
brightonkeller

and if you can't provide support, then could I somehow hire somehow? There's got to be a way I can make this work!

Share this post


Link to post
Share on other sites
Danny

Hi Brighton,

 

Our documentation for creating sections is available and quite indepth. However, if you do not have more than basic understanding of PHP, then you I would suggest you hire one of our Pros. If you contact our helpdesk, our support team there will provide you with contact information for all our pros.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
brightonkeller

So now I'm trying to use the HOOKER plugin and insert hook "pagelines_loop_after_exerpt"

 

and I have read about this A LOT and how to use ACF properly. IT seems pretty straight forward but for some reason it's not working for me. 

 

I inserted the following code (after reading documentation on ACF website here): 

<p><?php the_field('shop_post'); ?></p>

'shop_post' is what I called my custom field when creating it. Do you have any reason why this isn't working or should I contact the ACF developers maybe? 

 

Any help would be greatly appreciated! 

 

I'm using the new pagelines postloop format - see screenshot here (I can't figure out how to upload to post) 

Share this post


Link to post
Share on other sites
Danny

Can you provide a screenshot of the full code you have used please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dawsonbarber

Depending on what you're trying to accomplish and the number of posts you may need to publish, there might be a better way of doing this (using a custom post type with custom fields).

 

Could you elaborate on what, specifically, you want to do (and perhaps provide a link to the site you referenced in the 404'd screenshots)?

Share this post


Link to post
Share on other sites
brightonkeller

basically I want to be able to use the Advanced Custom Fields plugin via hooker and I can't really figure out how! 

Share this post


Link to post
Share on other sites
dawsonbarber

Could you could be more specific about what you want to accomplish with ACF via hooker - i.e., what's the output you're hoping to achieve?

Share this post


Link to post
Share on other sites

×