خوش آمدید♥

برای دریافت آخرین بروزرسانی‌های افزونه، استایل و ... نیازمند ثبت‌نام در انجمن می‌باشید تا با ما بروز بمانید!

ثبت نام!
  • هاست سان
  • با خرید اشتراک ویژه شما میتوانید جدیدترین آپدیت افزونه ها و قالب های زیبا و پرکاربرد زنفورو را دریافت کنید!

    هر ماه یک کد تخفیف 60 درصدی محصولات فروشگاه به کاربران منتخب بخش ویژه اهدا می‌شود

  • انجمن مجهز به سیستم تشخیص کاربران دارای چند حساب کاربری می‌باشد در صورت مشاهده حساب کاربری شما مسدود میگردد.
Banner Advert Generator

افزونه 2 Banner Advert Generator 1.0.0

دسترسی دریافت را ندارید
پشتیبانی از نسخه های
  1. 2.0
  2. 2.1
This is a tool for developers who are styling their advert placements.

While working on styling programmatic banner adverts for my site, I got frustrated with external adverts (eg Adsense / DFP / etc) that wouldn't display consistently on my dev machine - so I built a tool which generates static advert images (of any size!) for me.

banner-advert-generator.png

This tool is accessed via a template function where you specify the size of the advert and optionally, an id for the div and the colour (if you want to override the default).

{{ banner(<width>, <height>, <div id (optional)>, <colour (optional)>) }}

For example, the following template code:

{{ banner(728, 90, 'advert-above-breadcrumb', 'blue') }} will generate the following HTML:

کد:
لطفا گزینه ورود یا ثبت‌نام را انتخاب کنید تا کدها برای شما قابل نمایش شوند


Permitted colour strings are: 'black', 'red', 'green', 'blue', 'yellow', 'cyan', 'magenta', 'grey', or 'white'

The template function will automatically generate the banner image for you if it doesn't already exist.

The template function is intended to be used in XenForo Advertising placements, but can also be used anywhere template syntax is allowed, including in a HTML widget.

This addon can also be useful for generating advert placeholders when taking screenshots for your advertising media kit!

Usage:

To use, install the addon, then create a new advertisement (disable your other advertisement code for that placement temporarily while you work on the styling).

Use the banner function to generate the desired size advert and then add any other HTML you might use to style the advert. You can add custom CSS to your extra.less template.

For example:

banner-advert-generator-1.png


Options:

There are two options you can configure - the path the images are saved (relative to the data directory) and the default colour to use when no colour is explicitly specified.

banner-advert-generator-2.png

Note:

Uninstalling the addon will not remove the images that were created. Given this addon would typically only be used on a dev or test server and not in production, this should not be an issue. Either way, removing the directory and all images contained in it will cause no issues (provided that you did not specify a directory used by anything else!) - images will be automatically regenerated as required while the addon is in use.

Hint:

Because the banner is served as an image, and images are displayed inline by default, you may find a small padding (around 5px) added below the banner.

You can over-ride this by applying the display: block; CSS to your banner styling for images served within your advert div.

for example:


کد:
لطفا گزینه ورود یا ثبت‌نام را انتخاب کنید تا کدها برای شما قابل نمایش شوند
  • لایک
واکنش‌ها[ی پسندها]: XFFA.IR Bot
نویسنده
Dariush
دریافت‌ها
2
بازدیدها
300
اولین انتشار
آخرین بروزرسانی
رتبه‌بندی
0.00 ستاره 0 رتبه‌بندی

فایل‌های بیشتری از Dariush

بالا پایین