Делаем знак рубля вместо р.

Павел Хорошевский расскажет как это делается на примере HostCMS v.6, но аналогичную манипуляцию можно сделать на любом движке. Немаловажным остаётся тот факт, что при копировании с сайта цены с обозначением знака рубля и вставка в любой другой документ приведут к вставке цены с р.
1. Добавить в макет вызов специального стиля:

<link rel="stylesheet" type="text/css" href="/hostcmsfiles/rouble.css" media="all" />

2. Положите этот стиль в соответсвующую папку:

    @charset "utf-8";
    /* CSS Document */

    @font-face {
    font-family: 'rouble-regular';
    src: url('roubleariel-webfont.eot');
    src: local('rouble'), local('roublearial'), url(data:font/truetype;charset=utf-8;base64,AAEAAAAQAQAABAAARkZUTVhBTW0AAAEMAAAAHEdERUYAQwAEAAABKAAAACBPUy8yg7ye3AAAAUgAAABgY21hcDIeTMwAAAGoAAABgmN2dCAAVQM/AAADLAAAAAhmcGdtD7QvpwAAAzQAAAJlZ2FzcAADAAcAAAWcAAAADGdseWavI55AAAAFqAAAAPRoZWFk84ylgAAABpwAAAA2aGhlYQWmAiEAAAbUAAAAJGhtdHgW3wA3AAAG+AAAAFhsb2NhA9ADVgAAB1AAAAAubWF4cAEwAKgAAAeAAAAAIG5hbWUkOkAgAAAHoAAAAbhwb3N0fiU/kQAACVgAAADccHJlcFvIu3kAAAo0AAAAQAAAAAEAAAAAxtQumQAAAADItm30AAAAAMi2sN8AAQAAAA4AAAAYAAAAAAACAAEAAQAVAAEABAAAAAIAAAADAS8BkAAFAAQCvAKKAAAAjAK8AooAAAHdADIA+gAAAgAFAAAAAAIABAAAAgMAAAAAAAAAAAAAAABweXJzAEAAICBfAu7/BgAAAt0AAAAAAAUAAAAAAAAAAAAAACAAAQAAAAMAAAADAAAAHAABAAAAAAB8AAMAAQAAABwABABgAAAAFAAQAAMABAAgAC4AoAQxBEAEQyAKIC8gX///AAAAIAAuAKAEMQRABEMgACAvIF/////j/9b/ZfvV+8f7xeAJ3+XftgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEGAAABAAAAAAAAAAECAAAAAgAAAAA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bAAgAFIAZQBnAHUAbABhAHIAVgBlAHIAcwBpAG8AbgAgADEALgAwADAAMAByAG8AdQBiAGwAZQBhAHIAaQBhAGwAVABoAGkAcwAgAGYAbwBuAHQAIAB3AGEAcwAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAAdABoAGUAIABGAG8AbgB0ACAAUwBxAHUAaQByAHIAZQBsACAARwBlAG4AZQByAGEAdABvAHIALgACAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAABYAAAABAAIAAwARAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgd1bmkwMEEwCWFmaWkxMDA2NglhZmlpMTAwODIJYWZpaTEwMDg1B3VuaTIwMDAHdW5pMjAwMQd1bmkyMDAyB3VuaTIwMDMHdW5pMjAwNAd1bmkyMDA1B3VuaTIwMDYHdW5pMjAwNwd1bmkyMDA4B3VuaTIwMDkHdW5pMjAwQQd1bmkyMDJGB3VuaTIwNUa4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFgAsAIgRbADK0QBsAMgRbADK0RZsBQr) format('truetype');
    font-weight: normal;
    font-style: normal;
    }

3. Добавьте в основную таблицу стилей класс

.rub, .rur {
font-family: 'rouble-regular';
}

4. В XSL шаблоне, отвечающем за вывод названия валюты найдите:

<xsl:value-of select="currency"/>

и замените на:

<xsl:choose>
<xsl:when test="currency = 'р.'">
<span>р.</span>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="currency"/>
</xsl:otherwise>
</xsl:choose>

По теме:

Комментарии

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *