Jump to content

IPB 4.0 theme url


steve00

Recommended Posts

Are you trying to point to an image or a CSS file?

 

To load an image you use the tag given to you in the Manage Images section for your theme.

To load a CSS file you use code similar to this:

 

\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'css_file.css', 'core', 'front' ) );

 

Link to comment
Share on other sites

Bump

 

If it helps am looking for similar code to do same as in ipb 34.x e.g.

url({style_images_url}

but need similar way to do the above but in IPB 4

​We don't use url for images no more if that what sort asking it all using location and app to know image its needs both in css and in html but sorry if miss understand the question Steve if i am wrong.

Link to comment
Share on other sites

All I am trying to do is add a font file so need to know how to enter something similar to above code (or whatever format IPB 4 now uses) so can reference the folder in css file where font is which am placing in images folder for theme otherwise will not get exported with skin

There must be some kind of variable or path or something so can reference from css file ?

Link to comment
Share on other sites

in your theme go to Custom Settings and create new Setting and assign the Type to url and insert your desired link in the Default Value 

after that in you css file you can use it as {theme="font_url"} that will point to the link (font_url is the setting key)

you need to do it while designer mode is enabled 

her i changed the body background to this image

 

body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 18px;
	color: {theme="text_color"};
	height: 100%;
	background-color: {theme="page_background"};
    background-image: url({theme="image_url"});
}

 

i hope this was helpful to you 

Link to comment
Share on other sites

would this be exported with a skin for installing at new location ?

 

UPDATE: Would appear would not export with theme as appears would be using the url I enter which would be on my server

I am looking for url or variable or something that I can use to the theme or theme/image folder that would get exported with a skin, entering url to my site would not work as theme on another site would be trying to accessing my site for the file

Hope the above makes sense

Link to comment
Share on other sites

would this be exported with a skin for installing at new location ?

 

UPDATE: Would appear would not export with theme as appears would be using the url I enter which would be on my server

I am looking for url variable or something that I can use to image folder that would get exported with a skin, entering url to my site would not work as theme on another site would be trying to accessing my site for the file

Hope the above makes sense

​hi steve not sure if this is the route like use but been thinking why not use font from Google font family unless custom font then would work and using standard URL or have you tried it and never worked.

Link to comment
Share on other sites

​hi steve not sure if this is the route like use but been thinking why not use font from Google font family unless custom font then would work and using standard URL or have you tried it and never worked.

afraid it is custom font not available on google

just trying to work out how to add to css file ... something along lines of

@font-face
{
font-family: myFont;
	src: url({image="font1.ttf" app="core" location="image"}),
}

the above just does not work so am looking for a way to reference the font in the themes images folder

this used to be so easy in earlier versions as just used {style_images_url} but seems not able to anything similar in IPB4 without actually adding code into globalTemplate which I am trying to avoid

So either something similar to above code or similar to following is what am looking for:

@font-face
{
font-family: myFont;
	src: url({theme_url}/images/core/custom/font1.ttf"}),
}

 

Link to comment
Share on other sites

I notice from the other CSS files (eg flags.css), Steve, that the format for referencing an image takes the form

background: url({image="flags16.png" app="core" location="global"}) no-repeat;

The location of the images directories etc are determined by the location of the CSS.

Since you mention webfonts, I thought it might be handy to show you how I got them working on mine. I created a directory called fonts in which to store them, and then edited custom.css with the following:

@font-face {
    font-family: 'DejaVuSans';
    src: url('../fonts/DejaVuSans-webfont.eot');
    src: url('../fonts/DejaVuSans-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/DejaVuSans-webfont.woff') format('woff'),
         url('../fonts/DejaVuSans-webfont.ttf') format('truetype'),
         url('../fonts/DejaVuSans-webfont.svg#open_sansregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

Does that help?

Link to comment
Share on other sites

All I am trying to do is add a font file so need to know how to enter something similar to above code (or whatever format IPB 4 now uses) so can reference the folder in css file where font is which am placing in images folder for theme otherwise will not get exported with skin

There must be some kind of variable or path or something so can reference from css file ?

the problem with that meddysong you not exporting the items in that folder and Steve i have noticed there issues with export items at moment in beta 2 so hoping beta 3 fix so look at other option as unsure if we allowed create folder within /theme for items like font and because beta 2 is having exporting issues i not looked or tested it.

Link to comment
Share on other sites

unsure if we allowed create folder within /theme for items like font and because beta 2 is having exporting issues i not looked or tested it.

​Not worried if create font folder within theme/theme folder but it is knowing the url or variable to use so as to use the font folder to access the font file

Link to comment
Share on other sites

yes, got it

Thanks to everyone who tried to help

No idea why didn't work before but seems to now:

For anyone else interested:

@font-face
{
font-family: myFont;

	src: url({image="font1.ttf" app="core" location="image"}),
	url({image="font1.ttf" app="core" location="image"});
}

No idea why it works but it does would have thought could only use that for images only being as using image=

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...