hamid

Show random advertisement

Vote 0 Votes

hi
i want display advertisement after each post .Which way do I use for this goal ? Is it better that I use custom fields ?
How do I use the code to display random advertisement?
thanks for help

Reported on Movable Type 5

5 Replies

| Add a Reply
  • Hi Hamid,

    I would guess that you want to display common ads for all your entries, which to display randomly.

    Assuming that this is the case, you don't need to use custom fields, because using custom fields assumes that the ads are specific to each and every entries.

    The best way for random ADS is to use one of the php scripts available online for this. You will put the ads in an array and you will display one time at a time, in a random order.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/

  • How is this way?
    i make a category ("ads") and show their contents random.
    Is there any code that 1- show random entries of a this categories ("ads") and 2- remove a category ("ads")from Category menu ?

  • If you want you could do it via that solution with the "ads" category.

    I told you that you could look for php scripts for random ads. If you want to do it with MT, try this plugin:
    https://github.com/rayners/movable-type-plugin-random-entries

    Hopefully, it would work on movable type v5.x.

    Add to it the parameter:
    category="ads"

    Then, to exclude this category from the other categories list, you would have to use this logic:

    </mt:Unless tag="CategoryLabel" eq="ads">

    ...

    </mt:Unless>

    Inside the mt:Categories loop that you're using.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/

  • mihai
    this plugin shown only in Administrator dashboard and not shown in site&bolg dashboard .
    how can i use it?

  • Use the sample from the URL that I've provided you above.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

137 479

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

238 797

Last Topic: Manifest Schema Compatibility Issue When Restoring Blog by Matt on Oct 17, 2012

1858 6594

Last Topic: Categories and Basename Publishing Issues by e21media on Oct 25, 2012

88 307

Last Topic: absolute publish date in Manage Entries screen by .mau. on Apr 18, 2012

1488 5347

Last Topic: Anti-cloning by .mau. on Oct 29, 2012

732 3093

Last Topic: Blog moved server - now users cannot access blog? by mowgs on Oct 30, 2012

89 317

Last Topic: How to "pretify" a url in htaccess with a few wildcards by Caio on May 30, 2012

183 771

Last Topic: Commenting with TypePad by Rob Ferrara on Oct 17, 2012

212 680

Last Topic: Does MT-Approval work in MT5? by DLpres on Sep 25, 2012

27 100

Last Topic: Upgrading MT by Caio on Oct 15, 2012

49 224

Last Topic: Movable Type 6 Ideas by Caio on May 28, 2012

65 248

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012