shortlist-digital/agreable-advert-plugin 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

shortlist-digital/agreable-advert-plugin

Composer 安装命令:

composer require shortlist-digital/agreable-advert-plugin

包简介

A tres agreable Adverts plugin for Croissant compatible sites

README 文档

README

Wordpress Plugin built for Croissant stack using Herbert plugin framework.

Use within Twig

Get advert HTML

<!-- Twig function -->
{{ get_advert_html(post, 'horizontal', [{'pos': 'top'}]) }}

<!-- Outputs -->

<div data-module='AdvertSlot' data-advert-id='a876sd7f65sd76f'>
  <script type='application/json'>
    { ...advert object } 
  </script>
</div>

Get advert data

<!-- Twig function -->
{{ get_advert_data(post, 'horizontal', [{'pos': 'top'}]) }}

<!-- Outputs -->
{
  'type': 'horizontal',
  'key-values': [{'pos': 'top'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[970, 250], [728, 90]]
    }, 
    'tablet': {
      'creative-sizes': [[728, 90]]
    }, 
    'mobile': {
      'creative-sizes': [[320, 50]]
    }
  }
}

Use within PHP

$advert_data = AgreableAdvertPlugin\Services\AdvertSlotGenerator::get_advert_data($post, 'horizontal', ['pos' => 'top']);
var_dump($advert_data);
// Outputs
{
  'type': 'horizontal',
  'key-values': [{'pos': 'top'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[970, 250], [728, 90]]
    }, 
    'tablet': {
      'creative-sizes': [[728, 90]]
    }, 
    'mobile': {
      'creative-sizes': [[320, 50]]
    }
  }
}

API routes

Get a single advert, rendered as HTML, complete with container CSS and JS to load (for Instant Articles):

/advert/{post_id}/{post_type}/{key_values}
/advert/2074/horizontal/pos=top,another_key=value

Ad type

Horizontal

  • Billboard 970x250
  • Leaderboard 728x90
  • Mobile banner
{
  'type': 'horizontal',
  'key-values': [{'pos': 'top|2'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[970, 250], [728, 90]]
    }, 
    'tablet': {
      'creative-sizes': [[728, 90]]
    }, 
    'mobile': {
      'creative-sizes': [[320, 50]]
    }
  }
}

Vertical

  • HPU 300x600
  • MPU 300x250
{
  'type': 'horizontal',
  'key-values': [{'pos': 'top|2'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[300, 600], [300, 250]]
    }, 
    'tablet': {
      'creative-sizes': [[300, 600], [300, 250]]
    }, 
    'mobile': {
      'creative-sizes': [[300, 250]]
    }
  }
}

In-Article

{
  'type': 'in-article (tbc)',
  'key-values': [{'pos': 'top|2'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[300, 600], [300, 250]]
    }, 
    'tablet': {
      'creative-sizes': [[300, 600], [300, 250]]
    }, 
    'mobile': {
      'creative-sizes': [[300, 250]]
    }
  }
}

Skin

{
  'type': 'skin',
  'key-values': [{'pos': 'skin', 'pos': 'l|r'}],
  'devices': {
    'desktop': {
      'creative-sizes': [[300, 900]]
    }
  }
}

统计信息

  • 总下载量: 1.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固