WordPress.org

Ready to get started?Download WordPress

Forums

Feature A Page Widget
[resolved] custom template for a widget (9 posts)

  1. Zied Ellouze
    Member
    Posted 1 year ago #

    Hello
    I want to know if it is possible to create a custom template to display a widget I found this folder "fpw_views" I do not know if I can personalized it
    thank you very much

    http://wordpress.org/extend/plugins/feature-a-page-widget/

  2. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @zied86.

    You're headed down the right path. Check out "How can I modify the widget design or output?" on the FAQ page. You'll see that there is a safe way to create a new template in your theme using that fpw_views folder.

    However, I would encourage you to try to use CSS or a filter first if possible as those are the most future-friendly ways of modifying the plugin. (I will do my absolute best to make the templating work in the future, but new features will almost certainly require modifying the template.)

    So take a look at that FAQ answer and let me know if you have any other questions.

  3. Zied Ellouze
    Member
    Posted 1 year ago #

    thank you for your answer
    I looked for a feature such as this "template file name" in this plugin
    http://wordpress.org/extend/plugins/flexible-posts-widget/screenshots/

  4. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Glad to help!

    What are you actually trying to do? Are you saying that the existing templating structure for the plugin isn't working for you?

  5. Zied Ellouze
    Member
    Posted 1 year ago #

    I would love to use this plugin
    it is excellent
    my problem that the template HTML site that I'm developing, there are several display example

  6. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Is the issue that you need multiple different widget layouts for different pages? Maybe a link or screenshot might help show me the problem?

    Each widget gets a class specific to the page it features, so you can get a long way with CSS or use a conditional statement in the widget layout based on the page id.

  7. Zied Ellouze
    Member
    Posted 1 year ago #

    thank you for your follow-up
    Here is an example
    http://img248.imageshack.us/img248/2995/widgetv.jpg
    the first 3 pages have the same style
    the 4 th item has a specific display
    same for the 5th item

    Note the picture:
    1-title
    2-the excpert
    3-read more
    4- featured picture

    Thank you

  8. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Ok. Thanks for the details.

    Unfortunately, you're right that right now this plugin does not support multiple templates. You could technically do this in the current single widget layout template with conditionals (pseudo-code), but I wouldn't recommend it as that would be hard to maintain.

    if( in_array( $featured_page_id, array( 12, 47, 93 ) ) {
        /* custom widget layout #1 */
    } elseif( in_array( $featured_page_id, array( 43, 32 ) ) {
        /* custom widget layout #2 */
    }

    I may add more advanced templating at some point in the future, but I'll be honest and tell you that it probably won't be high on the priority list. However, I've added it to the features poll, so make sure to go there and vote for it and any other features you would like.

  9. Zied Ellouze
    Member
    Posted 1 year ago #

    Thank you for your follow-up
    I'll try
    In any case, thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.