Forum Open Notice
Forum Open Notice
  1. Forum
  2. Search

Advanced Search

Search Options

Search Results Displaying 1–20 out of 483 results.

English K2 Community 4 years 11 months ago

Re: how to convert k2 items to default joomla articles

There are some considerations here concerning galleries, images and extra fields

Galleries
K2 galleries are stored in media/k2/galleries Each gallery has a folder with the id of the article as the name of the folder. 
You can copy this directory and all its content to the images folder

Joomla articles can make use of SIG-pro, but it handles it differently. Where K2 stores the reference in a separate database field, Joomla articles has the code within the text of the article, like {gallery}name_of_folder{/gallery}

To add this gallery code to your articles, add the following to the sql query:

concat_ws('<br/>',`fulltext`, `gallery`) AS 'fulltext

The query will become:
 
INSERT INTO `DATABASENAME_PREFIX`.`PREFIX_content` (`id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `language`)
SELECT `id`, `title`, `alias`, `catid`, `introtext`, concat_ws('<br/>',`fulltext`, `gallery`) AS 'fulltext', `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `access`, `featured`, `hits`, `LANGUAGE`
FROM `si3ow_k2_items`;

Images
K2 has no reference to images in the database. The images are stored in media/k2/items/cache/. When you create a new article and add a header image, K2 will create 6 versions of that image. The filename is a MD5 hash of the word 'Image' and the id of the article (Note the capital I in Image). Followed by _Generic, _L, _M, _S, _XL and _XS. All images are in jpg format, even if the original is png or gif.

You can copy all the files from the cache directory to your images folder. I would suggest to create a subfolder called K2 or something of your liking, inside the folder stories.

You can choose which one of the 6 file sizes you want to use with your Joomla articles, and you can even use different sizes for intro text and for full text. The sql-code for creating a reference to the correct (extra large) file will be: 

CONCAT(MD5(CONCAT('Image',`id`)), '_XL.jpg')

Joomla content stores a reference to both intro text and full text in one field images. The content of that field is JSON format. 
{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}

Note that where K2 has two fields for the image caption (caption and credits), content only has a caption.
So the query for the XL images set as intro and full text will become:

CONCAT('{"image_intro":images\/stories\//k2"',MD5(CONCAT('Image',`id`)), '_XL.jpg','"float_intro":"","image_intro_alt":',`title`,'"","image_intro_caption":"',CONCAT(`image_caption`, ' Credits: ',`image_credits`),'","image_fulltext":',MD5(CONCAT('Image',`id`)), '_XL.jpg','"","float_fulltext":"","image_fulltext_alt":"',`title`,'","image_fulltext_caption":"',CONCAT(`image_caption`, ' Credits: ',`image_credits`),'"}' ) 

So the complete query should be:

INSERT INTO `DATABASENAME_PREFIX`.`PREFIX_content` (`id`, `title`, `alias`, `catid`, `introtext`, `fulltext`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `images`, `access`, `featured`, `hits`, `language`)
SELECT `id`, `title`, `alias`, `catid`, `introtext`, concat_ws('<br/>',`fulltext`, `gallery`) AS 'fulltext', `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, CONCAT('{"image_intro":images\/stories\//k2"',MD5(CONCAT('Image',`id`)), '_XL.jpg','"float_intro":"","image_intro_alt":',`title`,'"","image_intro_caption":"',CONCAT(`image_caption`, ' Credits: ',`image_credits`),'","image_fulltext":',MD5(CONCAT('Image',`id`)), '_XL.jpg','"","float_fulltext":"","image_fulltext_alt":"',`title`,'","image_fulltext_caption":"',CONCAT(`image_caption`, ' Credits: ',`image_credits`),'"}' ), `access`, `featured`, `hits`, `LANGUAGE`
FROM `DATABASENAME_PREFIX`.`PREFIX_k2_items`;

(MySQL throws me an error. I'm not sure where it's wrong sad.png )

Extra fields
All of this doesn't covert your K2 extra fields to Joomla custom fields. K2 stores the extra fields information in one singe field in the items table. The format is JSON.
Joomla stores the custom fields in a separate table, with a row for each custom field value and a reference to the article id.

I have no idea how to convert the extra fields to custom fields with sql.

Note
Be aware the query above will insert the K2 item ID into the Joomla content table. If you already have articles in Joomla content, this might lead to conflicts.

 
English K2 Community 5 years 1 month ago

Image float

Hi I´m strugle with floating article intro image

When I make these changes i Google Chrome, It´s look as I want:

"div.catItemImageBlock {padding:8px 0;margin: 0 16px 16px 0;float:left;}"

Then I make this changes in the k2.css nothing happens, why?
Simple RSS Feed Reader 5 years 8 months ago

Module Not Picking Up Feed Images

Hi Fotis,

We are using this module on this site www.yachtinglife.co.uk/ which is pulling in a couple of feeds from these two urls:
afloat.ie/sail/northern-ireland-waters?format=feed
afloat.ie/sail/scottish-waters?format=feed

We previously had the images added into the main K2 'Images' tab and the feeds were working fine but we have now moved to having the images being loaded in the 'Media' tab from an external source. The Scottish Waters feed still works as none of the articles in it use the new layout at the moment but the Northern Ireland Waters is not working as expected as it's images are in using the new method. The images still appear within the description in the feed, the only differences are that they appear after the text now and the div the surround it has a different class name. Any idea why the module wouldn't be picking up the other images?

Thanks,
Dave
Offizielle deutsche Gemeinschaft 5 years 11 months ago

Ausrichtung Artikelbild

You need to override the image container's CSS styles: jmp.sh/kJlooD8

This float:right takes precedence over any align property on the image it contains. Since K2's CSS file is loaded before your site's, you can simply override any CSS rule defined in it.
AllVideos 5 years 11 months ago

No video with suported format and MIME type found

Hello,
I find the same problem with the failure No video with... in Firefox latest Ver. and Joomla Ver. 3.9.23, PHP 7.4.13
I checked all entries in the plugin. They are correct.

I can use HTML5 code <video style="float: right; margin: 8px;" src="images/videos/video.mp4" controls="controls" width="640" height="480"></video>.
This will show the video and I can play it.
The code for Allvideos {mp4}images/videos/video.mp4{/mp4} will produce the failure.

I checked your installation doc.

Any ida?

regards
Comunità italiana K2 6 years 3 weeks ago

Unhandled exception - Error

Salve a tutti, ricevo questa segnalazione di errore sul mio sito:

This message contains confidential information


Come posso intervenire?
Comunidad hispana oficial de K2 6 years 5 months ago

No se ven las thumbnail en el evento desde que actualice k2_v2. 10.3.

Hola, esta es la fracción de código que afecta al evento. ¡Muchas gracias de antemano!


<!-- Item Next / Prev with thumbnail -->
<div class=" post-nav">

<div class="uk-width-medium-1-2 uk-float-left pprev">
<?php if(isset($this->item->previousLink)){ ?>
<div class="thumbnail">

<a href="<?php echo $this->item->previousLink; ?>">
<img src="<?php echo $this->item->previousImageSmall; ?>" >
</a>
</div>
<div class="pn-left">
<a href="<?php echo $this->item->previousLink; ?>" rel="prev"><span class="pnav-entry art italic">Más antiguo </span> <span class="pnav-tit ux-title"> <?php echo $this->item->previousTitle; ?> </span></a> </div>

<?php } ?>
</div>
<div class="uk-width-medium-1-2 uk-float-right pnext">
<?php if(isset($this->item->nextLink)){ ?>
<div class="pn-right">
<a href="<?php echo $this->item->nextLink; ?>" rel="next"><span class="pnav-entry art italic"> Más nuevo </span> <span class="pnav-tit ux-title"> <?php echo $this->item->nextTitle; ?> </span> </a> </div>
<div class="thumbnail">
<a href="<?php echo $this->item->nextLink; ?>">
<img src="<?php echo $this->item->nextImageSmall; ?>" >
</a>
</div>
<?php } ?>
</div>
<div class="clear"></div>
</div>
English K2 Community 6 years 6 months ago

Item list in category - item image LEFT of title+created time+introtext

Hi, i tried to follow these 2 guides but to no avail:
1) www.joomlashack.com/blog/joomla-components/what-k2-sub-templates-are-and-how-to-create-them/
2) www.joomlaworks.net/forum/k2-en/19225-get-intro-text-to-wrap-next-to-the-item-image

What i did:
- copied the custom folder in /templates/your_joomla_template/html/com_k2/ and renamed it to my liking
- opened item.php and deleted the clearing div just below <!-- Image credits -->, as shown in guide 2. Tried also doing the same in category_item.php but to no avail
- added the css sheet path in both item.php and category_item.php (guide 2)
- added the float left thing in that css file

I still have the image ABOVE the rest, can you help me? THX
English K2 Community 6 years 11 months ago

K2 Item Hits

Hi Fotis,

On afloat.ie/ we have been using a hit counter to display article views but unfortunately this doesn't work with the caching system we would like to implement to help speed the site up. We have implemented a new page counter using an svg image to track and increment the hits and would like to completely turn off the K2 one rather than just disabling it in the frontend. We found that this isn't possible currently so is this a setting that you would be able to implement in the backend settings?

Dave
English K2 Community 7 years 3 months ago

Problem with display / linking of K2 - Articles on Joomla - Website

Thanks for that; just saw your reply now. If it may interest you, I figured a way to easily customize the k2 - content module layout for the articles via custom css, after some HOURS of trying to find the right lines. This solution is however quite good I feel, because it even makes the layout responsive for phones or tables, and maintains the three-column structure for smaller screens too. Just make sure you use appropriate image and font sizes:

.intro_css{
width: 100%;
display: block;
float: left;
}
div.k2ItemsBlock ul li{
margin-bottom: 20px;
width: 33.33%;
float:left;
}
div.k2ItemsBlock ul li a.moduleItemTitle{font-size:12px;}
div.k2ItemsBlock{text-align-center}

the two last lines set the font size of an article to 12 (not too big to not cause layout problems on small screens while remaining responsive) and set the title to be centered, respectively.
English K2 Community 7 years 6 months ago

RSS Feeds

Hi Fotis,

Got another question/suggestion for you. I am trying to create an RSS feed (afloat.ie/itemlist?format=feed&type=rss) in a Mailchimp newsletter for a client but it is not picking up the images as they are added within the 'description' tag rather than a media tag. Is there any way that this can be changed?

Thanks,
Dave
English K2 Community 8 years 2 weeks ago

Sorting by date - Picture left

Hi Alex,

This can be done simply by customizing your css, just insert this css rule in your custom css file
div.catItemImageBlock { float: left; }
Offizielle deutsche Gemeinschaft 8 years 3 weeks ago

Datumsanzeige - Bilder links anordnen

Hallo,
gibt es eine Möglichkeit, dass die Bilder nicht über dem Text, sondern links davon angeordnet werden.
.TagItemView .TagItemImageBlock {float: left;} fand ich dazu im Forum - das hilft aber nichts.

Beispiel: derkompetenzentwickler.at/component/k2/itemlist/category/193?Itemid=2115

Vielen Dank,
Alex
English K2 Community 8 years 1 month ago

need help for media manager

hi
i floated the media manager divs to right ,
but after floated this code to right the images icons not show ::
.elfinder-ltr .elfinder-cwd-view-icons .elfinder-cwd-file{float:right !important;margin: 0 0 2px 3px !important;}

how to show the images icons with RTL direction ?
English K2 Community 8 years 2 months ago

K2 Content Wall

Hi everyone,

I'm new to this and I'm starting with a website that uses the slider "JoomlaXTC K2 Content Wall v1.29.1". I beleive this is ti's name.

So my first intent was to call an item (with this banner: drive.google.com/file/d/1MDEMg5JXpwNQ33lQfUpKBinxVQ3x6r0h/view?usp=sharing), but to view a different image in the homepage slider (this one: drive.google.com/file/d/1d1E2K2Ld_NnaoyB6fab9AiiQNHptPOm_/view?usp=sharing).
and the idea was to do this for 3 items in total.
Obviously I wasn't able to do it, because the slider was calling only the item image. :(

Then I tried to use in the items banners the images I wanted in the homepage slider.
But the dimensions were wrong and the images were sliced on both ends.

I'm desperate.

Can anyone help me?

This is the code I have now:
/* Element Style */ .retroid_mainslide {height:750px; box-shadow: inset 0 0 120px rgba(0,0,0,1); background-repeat:no-repeat;} .page-1 .retroid_mainslide {background-position:left top;} .page-2 .retroid_mainslide {background-position: center top!important;} .retroid_mainslide .mainslidetint {background: url(shadow-sm.png) no-repeat; background-size:100% 100%;} .retroid_mainslide .slidetext {color:#fff!important; position:absolute; bottom:60px;font-weight:bold; width:100%;} .retroid_mainslide .slidetext .slidetext-a h2 {font-weight:bold!important; font-size:80px;line-height:95%!important; color:#fff!important;} .retroid_mainslide .writtenblock, .retroid_mainslide .dateblock, .retroid_mainslide .categoryblock {float:right;margin:22px 0 0 60px; padding-left:60px; border-left: 1px solid rgba(255,255,255,0.65); } .categoryblock {border:none!important;} .retroid_mainslide .categoryblock span, .retroid_mainslide .writtenblock span, .retroid_mainslide .dateblock span {color:#fff!important; font-size:12px; text-transform:uppercase;font-weight:bold; } .retroid_mainslide .slidetext .slidetext-a .categoryblock p, .retroid_mainslide .slidetext .slidetext-a .writtenblock p, .retroid_mainslide .slidetext .dateblock p {color:#fff!important; font-size:16px; margin-top:4px; font-weight:normal!important;} .retroid_mainslide .slidetext .slidetext-a {width:46%; padding-right:3.5%; border-right: 1px solid rgba(255,255,255,0.65); float:left; padding-top:30px; padding-bottom:30px;} .retroid_mainslide .slidetext .slidetext-b {width:40%; padding-left:3.5%; float:left; padding-top:30px; padding-bottom:30px;text-align:left;} .retroid_mainslide .slidetext .slidetext-b p {font-size:24px; color:#fff!important; font-weight:100!important;letter-spacing:1px;text-align:left;margin-top:3px;display:block;line-height:140%!important;} .retroid_mainslide .slidetext .slidetext-b .morelink {background:none!important; border:1px solid rgba(255,255,255,0.65); color:#fff!important; font-size:12px; padding:6px 32px 7px; text-transform:uppercase; font-weight:bold; margin-top:35px!important; display:inline-block;} .retroid_mainslide .slidetext .slidetext-b .morelink:hover {background:#fff!important; color:#333!important;} @media screen and (max-width: 1740px) { .retroid_mainslide .slidetext .slidetext-a h2 {font-size:60px; margin-top:3px!important;} .retroid_mainslide .slidetext .slidetext-b p {font-size:18px;} } @media screen and (max-width: 1440px) { .retroid_mainslide {height:870px;} } @media screen and (max-width: 1280px){ .retroid_mainslide {height:720px; background-size:1280px 720px!important;} .retroid_mainslide .slidetext .slidetext-a .writtenblock, .retroid_mainslide .slidetext .dateblock, .retroid_mainslide .slidetext .slidetext-a .categoryblock { margin:22px 0 0 30px; padding-left:30px;} .retroid_mainslide .slidetext .slidetext-b p {font-size:24px; margin-top:10px!important; letter-spacing:-1px;} } @media screen and (max-width: 930px){ .retroid_mainslide {height:600px;} .retroid_mainslide {text-align:center!important;} .retroid_mainslide .slidetext .slidetext-a, .retroid_mainslide .slidetext .slidetext-b {float:none!important; width:100%!important; padding:0px!important; text-align:center!important; border:none!important;} .retroid_mainslide .slidetext .slidetext-a .writtenblock, .retroid_mainslide .slidetext .dateblock, .retroid_mainslide .slidetext .slidetext-a .categoryblock { float:none!important; display:inline-block!important; margin:22px 0 0 0 !important; padding:0 40px !important; border:none; } .retroid_mainslide .slidetext .slidetext-a .dateblock {border-left: 1px solid rgba(255,255,255,0.65); border-right: 1px solid rgba(255,255,255,0.65);} .retroid_mainslide .slidetext .slidetext-b p {text-align:center!important; margin-top:30px!important; margin:0 30px;} } @media screen and (max-width: 500px){ .retroid_mainslide {height:445px!important; background-size:840px 470px!important; box-shadow:none!important;} .retroid_mainslide .slidetext .slidetext-a .writtenblock, .retroid_mainslide .slidetext .dateblock, .retroid_mainslide .slidetext .slidetext-a .categoryblock { display:none!important;} .retroid_mainslide .slidetext .slidetext-a h2 {font-size:46px!important; line-height:90%!important;} .retroid_mainslide .slidetext .slidetext-b p {font-size:18px; margin-top:8px!important;} .retroid_mainslide .slidetext .slidetext-b .morelink {margin-top:12px!important;} .page-1 .retroid_mainslide {background-position:-100px 0 !important;} }
English K2 Community 8 years 4 months ago

Re: Image to float on left with text on right - How to

Hello,

Can you send me a link to a category please?
English K2 Community 8 years 4 months ago

Re: Image to float on left with text on right - How to

I see this topic is old, so please forgive me.
I get the CSS change, but K2 puts a Clear div after the image, thus preventing the text from being on the right. How do I stop the Clear from being generated for the Category Images only? Php is not my forte.
Frontpage Slideshow 8 years 5 months ago

Slideshow On Front Page

I would like to have a slideshow of my articles which is clickable on the homepage, I also want images floating on the left and article on the right. I am sharing the link of homepage of my Banking Site
English K2 Community 8 years 7 months ago

k2 to com_content Issue

hi

I have more than 32,000 items , problem is when I started web site I have changed k2 core how image was renamed with watermark.

I used below code to save images without md5:
$handle->file_new_name_body = $row->alias.$row->id; .md5("Image".$row->id). change to .$row->alias.$row->id. md5("Image".$current->id) change to .$row->alias.$row->id. .md5("Image".$item->id). change to .$row->alias.$row->id. .md5("Image".$news_id). change to .$row->alias.$row->id.

Now I am migrating to WordPress and when converting items to content....Images can not be transferred to content even FG joomla is unable to import k2 images, and JA plugin k2 to content migration plugin also failed. in plugin I am using following code;
/** * Get the featured image * * @param int $item_id Item ID * @return string Image name */ private function get_featured_image($item_id) { $found_image_name = ''; [b]$image_md5 = ("p.alias" . $item_id);[/b] // Try to get the original image in the src folder $image_name = 'media/k2/items/src/' . $image_md5 . '.jpg'; $image_url = trailingslashit($this->plugin->plugin_options['url']) . $image_name; if ( $this->plugin->url_exists($image_url) ) { $found_image_name = $image_name; } else { // if the featured image doesn't exist in the src folder, try to get the XL image in the cache folder $image_name = 'media/k2/items/cache/' . $image_md5 . '_XL.jpg'; $image_url = trailingslashit($this->plugin->plugin_options['url']) . $image_name; if ( $this->plugin->url_exists($image_url) ) { $found_image_name = $image_name; } } return $found_image_name; }

or
private function _convertK2Items($batch = 50) { $k2items = $this->fetchItems($batch); // select items with cat and extra fields condition. $numItems = count($k2items); if (!$numItems) { return 0; } $qi_q = 'INSERT INTO #__content_meta (id, content_id, meta_key, meta_value , encoded) VALUES '; $qi_v = array(); $count=0; foreach ($k2items AS $k => $v) { $tags = array(); $assoc = $this->checkAssociation($v->id, 'item'); if (!$assoc) { // Copy Image from K2. if (JFile::exists(JPATH_ROOT . '/media/k2/items/src/' . 'alias' . $v->id . '.jpg')) { JFolder::create(JPATH_ROOT . '/images/joomlart/article/'); // create recusive folder. copy('../media/k2/items/src/' . 'alias' . $v->id . '.jpg', '../images/joomlart/article/' . 'alias' . $v->id . '.jpg'); $images = array( 'image_intro' => 'images/joomlart/article/' . 'alias' . $v->id . '.jpg', 'float_intro' => '', 'image_intro_alt' => $v->image_caption, 'image_intro_caption' => $v->image_credits, 'image_fulltext' => 'images/joomlart/article/' . 'alias' . $v->id . '.jpg', 'float_fulltext' => '', 'image_fulltext_alt' => $v->image_caption, 'image_fulltext_caption' => $v->image_credits ); $images = json_encode($images); } else $images = ''; // Convert Tag id from k2 to new id. if ($v->tags_id != NULL) { $tags_id = explode(',', $v->tags_id); foreach ($tags_id AS $tg) { $tag = $this->checkAssociation($tg, 'tag'); if($tag) { $tags[] = $tag->key; } } } 
please tell me how can i force plugin to find images with naming alias.itemid.jpg.....please
Simple Image Gallery 8 years 8 months ago

black thumbnails if used in K2 category

SOLVED - it was my template killing images in K2 categories (???) with this
div.itemListCategory img { display: none !important; }

so I added this - ugh, nasty
div.itemListCategory img.sigFreeImg { display: block !important; float: none; }