Keyword

Advanced Search

Search Results (Searched for: Joomla K2 user extra fields)

  • Thomas Phillips
  • Thomas Phillips's Avatar
08 May 2019 23:51
Thomas Phillips replied the topic:media manager blank - plus cannot upload or browse for image

media manager blank - plus cannot upload or browse for image

Category: English K2 Community

've uploaded the 2.9.1 dev version

this at least allows media manager to display

but still I cannot save images to items

after saving it displayed an unformulated page like this (with image details not saved)

Items
Categories
Tags
Comments
Users
User Groups
Extra Fields
Extra Field Groups
Media Manager
Information
K2 v2.9.1 [Dev Build]
Copyright © 2006-2019 JoomlaWorks Ltd.
  • Martijn Hartong
  • Martijn Hartong's Avatar
21 Feb 2019 11:34 - 21 Feb 2019 18:03
Martijn Hartong created the topic:Frontend Save & Close solution

Frontend Save & Close solution

Category: English K2 Community

Hi,

For my project I really needed a working Save & Close button with visible reloaded content. I read a lot of questions, but could not find the answer. Basicly there are two save buttons; one with hover class and the other sets local storage. Perhaps it's better with User state and/or setInterval, etc. Please find my html/js from itemform.php to discuss better solutions. Thanks
<table id="k2ModalToolbar" cellpadding="2" cellspacing="4">
			<tr>
				<td id="toolbar-save" class="button">
					<a href="#" onclick="Joomla.submitbutton('save');return false;">
						<i class="fa fa-check" aria-hidden="true"></i> <?php echo JText::_('K2_SAVE'); ?>
					</a>
				</td>
				<td id="toolbar-cancel" class="button">
					<a href="#">
						<i class="fa fa-times-circle" aria-hidden="true"></i> <?php echo JText::_('K2_CLOSE'); ?>
					</a>
				</td>
                <td id="toolbar-senc" class="button">
					<a href="#" onclick="Joomla.submitbutton('save');return false;">
						<i class="fa fa-bullseye" aria-hidden="true"></i> Save & Close
					</a>
				</td>
			</tr>
		</table>
$document->addScriptDeclaration("
	window.addEvent('domready',function () {
       	\$K2('#catid option').attr('selected', '1');
       	setTimeout(function(){
  		\$K2('#catid').change();
		}, 1000);
    });
	\$K2(function(){
    	\$K2('#toolbar-save').hover(
        function(){ $(this).addClass('active') },
        function(){ $(this).removeClass('active') }
		)
		if (localStorage.getItem('save')) {
			var k2ItemId = \$K2('input[name=id]').val();
			var sigProFolder = \$K2('input[name=sigProFolder]').val();	
            \$K2.ajax({
            	type: 'get',
                cache: false,
                url: K2SitePath + 'index.php?option=com_k2&view=item&task=checkin&cid=' +  k2ItemId + '&lang=' + \$K2('input[name=lang]').val()  + '&sigProFolder=' + sigProFolder,
                success: function() {
                   localStorage.removeItem('save');
                // Close modal
                    if (typeof(parent.\$K2.magnificPopup) !== 'undefined') {
                    	parent.window.location.reload();
                        parent.\$K2.magnificPopup.close();
                        }
                // Close window/tab
                    	if (top == self) {
                     		window.close();
                	}
		// localStorage.removeItem('save') MOVED UP AFTER SUCCESS FOR BROWSER COMPATIBILITY
               	}
         	});
		}
	});
	Joomla.submitbutton = function(pressbutton){
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		if (\$K2.trim(\$K2('#title').val()) == '') {
			alert( '".JText::_('K2_ITEM_MUST_HAVE_A_TITLE', true)."' );
		}
		if (\$K2.trim(\$K2('#catid').val()) == '0') {
			alert( '".JText::_('K2_PLEASE_SELECT_A_CATEGORY', true)."' );
		}
		else if (\$K2('#toolbar-save').hasClass('active')) {
			syncExtraFieldsEditor();
			var validation = validateExtraFields();
			if(validation === true) {
				\$K2('#selectedTags option').attr('selected', 'selected');
				submitform( pressbutton );
			}			
		}
		else {
			syncExtraFieldsEditor();
			var validation = validateExtraFields();
			if(validation === true) {
				\$K2('#selectedTags option').attr('selected', 'selected');
				localStorage.setItem('save', 'itemsaved');
				submitform( pressbutton );				
			}
		}
	}
	
");
  • Fotis
  • Fotis's Avatar
16 Jan 2019 13:54
Fotis replied the topic:How to add k2 extra field inside the content

How to add k2 extra field inside the content

Category: English K2 Community

Then you should be looking at a plugin that copies the extra fields (values) from another item as its own. The gist is that both items should belong to categories that use the same extra fields group so that when you load to edit the item with the copied values, they show up just fine in the K2 item edit form.

Since this is a bit of an edge case, we can custom build the plugin for you if you sponsor it and we can open source it afterwards so it's constantly maintained by either us or other volunteers/users.

If you're interested, send us an email using the contact form here: www.joomlaworks.net/support/contact
  • Karin
  • Karin's Avatar
10 Jan 2019 16:19
Karin created the topic:Problem with frontend Editor (JCE) in K2

Problem with frontend Editor (JCE) in K2

Category: English K2 Community

Hi all,
I am having a problem with the frontend editor (JCE) in K2 since a few weeks.
The "extra fields" are shown in html, which makes it difficult for most users to edit their pages and it is not possible to save at all.
Does anyone have some hints what to do?
I am using joomla 3.9.0 with k2 2.9

Karin
  • Fotis
  • Fotis's Avatar
04 Jan 2019 01:55
Fotis replied the topic:Extra Fields for registered users only

Extra Fields for registered users only

Category: English K2 Community

@Mazen Regarding your first question, are you referring to data submission or data display? If it's the latter, you can simply wrap the output of the extra field you want to hide in an if statement that checks user permissions.

As for your 2nd question, there are many ways to do this. The simplest though is with Simple Image Gallery Pro ( www.joomlaworks.net/extensions/commercial/simple-image-gallery-pro ) and some K2 item.php overrides to show the gallery first (in place of the main K2 image).
  • Timothy Michel
  • Timothy Michel's Avatar
29 Oct 2018 23:27 - 30 Oct 2018 00:05
Timothy Michel replied the topic:After Update to K2 2.9 Extra Fields Don't Work At All

After Update to K2 2.9 Extra Fields Don't Work At All

Category: English K2 Community

I realize that a standardized CSS class naming structure, is essential for extensions developers, because how else could their products integrate into the design of a website; it would be impossible, all they could do is provide a generic look and feel and say "style to suit." With a standard set of classes, extensions can be installed and look like they belong on the site right out of the box.

After poking around the web, I came across this statement that suggests that CSS Grids and Bootstrap 4.0 will live happily together in Joomla 4:

Joomla 4 is currently in development. It may be many months before Joomla 4 is released, but we're already working on comparability for Joomlashack templates.

One of the most important changes in Joomla 4 is the upgrade from Bootstrap 2 to Bootstrap 4. However, one thing we've discovered is that Joomla 4 will not rely exclusively on Bootstrap.

Joomla 4 will also rely on CSS Grid Layout, a CSS method that is revolutionizing the frontend web design industry.

Bootstrap 4 and CSS Grid Layout will be the tools used for frontend design in Joomla 4. Joomla will rely on Bootstrap 4 for the user interface, and CSS Grid for the frontend layouts. The Joomla team are making this change because they believe that CSS Grid will be more future-proof. In Joomla 3, they were locked into an old version of Bootstrap. The hope is that this new approach will avoid similar problems with Joomla 4.

See: The Future of Joomla is CSS Grid, Not Bootstrap 4

It would seem, to me, that this is a reasonable approach, what do you think, considering what you said about the future of Bootstrap?
  • Timothy Michel
  • Timothy Michel's Avatar
29 Oct 2018 20:55 - 30 Oct 2018 01:17
Timothy Michel replied the topic:Content Not Displaying for one Category

Content Not Displaying for one Category

Category: English K2 Community

I will install the dev version of 2.9.1.

I had already set error reporting to maximum and didn't see any errors, only warnings, and not from K2 specifically.

The blank page occurs when I try to fetch it via a menu item or directly pasting the URL for the article/item, into the browser address bar.

I will let you know what else I find, but that will probably be tomorrow for you.

After installing K2-dev 2.9.1 I get the same result.

Curiously in error.log I see the following:

2018-10-29T06:44:49+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T07:56:51+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T09:08:33+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T10:22:21+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T11:37:01+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T12:48:48+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T14:03:04+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T15:17:58+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**
2018-10-29T16:31:21+00:00 INFO 62.102.148.166 joomlafailure **Username and password do not match or you do not have an account yet.**

Unless someone is using a script to try to guess a password, this should not be happening. I am the only person that logs into this dev site.

But I see no error pertaining to K2.

I have added:
<div class="watch-read-act-on-it">
	<h2>
		<?php 
		$menu = JFactory::getApplication()->getMenu();
		$active = $menu->getActive();
		$menuname = $active->params->get('page_heading');
		echo $menuname;
		?>
	</h2>
</div>

to my index.php file to display the Page Heading information in the Page Display tab in the Joomla Edit Menu Item interface, at the top of the page for all pages, and this displays correctly, So the problem comes after the menu item information is displayed.

This is really throwing me. It would almost imply a problem with item.php, But then the problem would show up everywhere and not just items called from these Hidden menus.

I added the following to item.php, but as far as I can see nothing is wrong here:
<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
	<!-- Item article Title Row 2 extra field -->
	<?php if(isset($this->item->extraFields->titleRowTwo->value)): ?>	  	
			<h2 class="itemTitleRow2"><?php echo $this->item->extraFields->titleRowTwo->value; ?></h2>
	<?php endif; ?>
	<!-- Item article SubTitle 1 extra field -->
	<?php if(isset($this->item->extraFields->subtitleOne->value)): ?>
		<h3 class="itemSubTitle1"><?php echo $this->item->extraFields->subtitleOne->value; ?></h3>
	<?php endif; ?>			
	<!-- Item article SubTitle 2 extra field -->
	<?php if(isset($this->item->extraFields->subtitleTwo->value)): ?>	  	
			<h4 class="itemSubTitle2"><?php echo $this->item->extraFields->subtitleTwo->value; ?></h4>
	<?php endif; ?>
<?php endif; ?>

I found this in jcontroller.log.php:

2018-10-29T01:22:32+00:00 INFO 47.41.20.188 controller Holding edit ID com_menus.edit.item.1197 Array ( [0] => 1197 )
2018-10-29T01:51:59+00:00 INFO 47.41.20.188 controller Releasing edit ID com_menus.edit.item.1197 Array ( )

And that is the menu item connected to the K2 item that I am trying to display. I am not familiar with holding and releasing, but it could mean holding data until after the page is rendered.
  • George
  • George's Avatar
23 Oct 2018 21:21
George replied the topic:K2 comments problem with plugin comments..

K2 comments problem with plugin comments..

Category: English K2 Community

OK I try to find it but I cant, can you help me where is this ?
<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<?php if(JRequest::getInt('print')==1): ?>
<!-- Print button at the top of the print page only -->
<a class="itemPrintThisPage" rel="nofollow" href="#" onclick="window.print();return false;">
	<span><?php echo JText::_('K2_PRINT_THIS_PAGE'); ?></span>
</a>
<?php endif; ?>

<!-- Start K2 Item Layout -->
<span id="startOfPageId<?php echo JRequest::getInt('id'); ?>"></span>

<div id="k2Container" class="itemView<?php echo ($this->item->featured) ? ' itemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">

	<!-- Plugins: BeforeDisplay -->
	<?php echo $this->item->event->BeforeDisplay; ?>

	<!-- K2 Plugins: K2BeforeDisplay -->
	<?php echo $this->item->event->K2BeforeDisplay; ?>

	<div class="itemHeader">

	<?php if($this->item->params->get('itemDateCreated')): ?>
	<!-- Date created -->
	<span class="itemDateCreated">
		<?php echo JHTML::_('date', $this->item->created, JText::_('K2_DATE_FORMAT_LC2')); ?>
	</span>
	<?php endif; ?>

	<?php if($this->item->params->get('itemTitle')): ?>
	<!-- Item title -->
	<h2 class="itemTitle">
		<?php if(isset($this->item->editLink)): ?>
		<!-- Item edit link -->
		<span class="itemEditLink">
			<a data-k2-modal="edit" href="<?php echo $this->item->editLink; ?>"><?php echo JText::_('K2_EDIT_ITEM'); ?></a>
		</span>
		<?php endif; ?>

		<?php echo $this->item->title; ?>

		<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
		<!-- Featured flag -->
		<span>
			<sup>
				<?php echo JText::_('K2_FEATURED'); ?>
			</sup>
		</span>
		<?php endif; ?>
	</h2>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthor')): ?>
	<!-- Item Author -->
	<span class="itemAuthor">
		<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>
		<?php if(empty($this->item->created_by_alias)): ?>
		<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
		<?php else: ?>
		<?php echo $this->item->author->name; ?>
		<?php endif; ?>
	</span>
	<?php endif; ?>

	</div>

	<!-- Plugins: AfterDisplayTitle -->
	<?php echo $this->item->event->AfterDisplayTitle; ?>

	<!-- K2 Plugins: K2AfterDisplayTitle -->
	<?php echo $this->item->event->K2AfterDisplayTitle; ?>

	<?php if(
		$this->item->params->get('itemFontResizer') ||
		$this->item->params->get('itemPrintButton') ||
		$this->item->params->get('itemEmailButton') ||
		$this->item->params->get('itemSocialButton') ||
		($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)) ||
		($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)) ||
		($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && $this->item->params->get('comments'))
	): ?>
	<div class="itemToolbar">
		<ul>
			<?php if($this->item->params->get('itemFontResizer')): ?>
			<!-- Font Resizer -->
			<li>
				<span class="itemTextResizerTitle"><?php echo JText::_('K2_FONT_SIZE'); ?></span>
				<a href="#" id="fontDecrease">
					<span><?php echo JText::_('K2_DECREASE_FONT_SIZE'); ?></span>
				</a>
				<a href="#" id="fontIncrease">
					<span><?php echo JText::_('K2_INCREASE_FONT_SIZE'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemPrintButton') && !JRequest::getInt('print')): ?>
			<!-- Print Button -->
			<li>
				<a class="itemPrintLink" rel="nofollow" href="<?php echo $this->item->printLink; ?>" onclick="window.open(this.href,'printWindow','width=900,height=600,location=no,menubar=no,resizable=yes,scrollbars=yes'); return false;">
					<span><?php echo JText::_('K2_PRINT'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemEmailButton') && !JRequest::getInt('print')): ?>
			<!-- Email Button -->
			<li>
				<a class="itemEmailLink" rel="nofollow" href="<?php echo $this->item->emailLink; ?>" onclick="window.open(this.href,'emailWindow','width=400,height=350,location=no,menubar=no,resizable=no,scrollbars=no'); return false;">
					<span><?php echo JText::_('K2_EMAIL'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?>
			<!-- Item Social Button -->
			<li>
				<?php echo $this->item->params->get('socialButtonCode'); ?>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?>
			<!-- Anchor link to item video below - if it exists -->
			<li>
				<a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('K2_MEDIA'); ?></a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?>
			<!-- Anchor link to item image gallery below - if it exists -->
			<li>
				<a class="itemImageGalleryLink k2Anchor" href="<?php echo $this->item->link; ?>#itemImageGalleryAnchor"><?php echo JText::_('K2_IMAGE_GALLERY'); ?></a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
			<!-- Anchor link to comments below - if enabled -->
			<li>
				<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
				<!-- K2 Plugins: K2CommentsCounter -->
				<?php echo $this->item->event->K2CommentsCounter; ?>
				<?php else: ?>
				<?php if($this->item->numOfComments > 0): ?>
				<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
					<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
				</a>
				<?php else: ?>
				<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"><?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?></a>
				<?php endif; ?>
				<?php endif; ?>
			</li>
			<?php endif; ?>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemRating')): ?>
	<!-- Item Rating -->
	<div class="itemRatingBlock">
		<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
		<div class="itemRatingForm">
			<ul class="itemRatingList">
				<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
			</ul>
			<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<div class="itemBody">

		<!-- Plugins: BeforeDisplayContent -->
		<?php echo $this->item->event->BeforeDisplayContent; ?>

		<!-- K2 Plugins: K2BeforeDisplayContent -->
		<?php echo $this->item->event->K2BeforeDisplayContent; ?>

		<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
		<!-- Item Image -->
		<div class="itemImageBlock">
			<span class="itemImage">
				<a data-k2-modal="image" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
					<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
				</a>
			</span>

			<?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
			<!-- Image caption -->
			<span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
			<!-- Image credits -->
			<span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span>
			<?php endif; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(!empty($this->item->fulltext)): ?>

		<?php if($this->item->params->get('itemIntroText')): ?>
		<!-- Item introtext -->
		<div class="itemIntroText">
			<?php echo $this->item->introtext; ?>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemFullText')): ?>
		<!-- Item fulltext -->
		<div class="itemFullText">
			<?php echo $this->item->fulltext; ?>
		</div>
		<?php endif; ?>

		<?php else: ?>

		<!-- Item text -->
		<div class="itemFullText">
			<?php echo $this->item->introtext; ?>
		</div>

		<?php endif; ?>

		<div class="clr"></div>

		<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
		<!-- Item extra fields -->
		<div class="itemExtraFields">
			<h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>
			<ul>
				<?php foreach ($this->item->extra_fields as $key => $extraField): ?>
				<?php if($extraField->value != ''): ?>
				<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>">
					<?php if($extraField->type == 'header'): ?>
					<h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
					<?php else: ?>
					<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
					<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
					<?php endif; ?>
				</li>
				<?php endif; ?>
				<?php endforeach; ?>
			</ul>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemHits') || ($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0)): ?>
		<div class="itemContentFooter">

			<?php if($this->item->params->get('itemHits')): ?>
			<!-- Item Hits -->
			<span class="itemHits">
				<?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?>
			</span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0): ?>
			<!-- Item date modified -->
			<span class="itemDateModified">
				<?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?>
			</span>
			<?php endif; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<!-- Plugins: AfterDisplayContent -->
		<?php echo $this->item->event->AfterDisplayContent; ?>

		<!-- K2 Plugins: K2AfterDisplayContent -->
		<?php echo $this->item->event->K2AfterDisplayContent; ?>

		<div class="clr"></div>

	</div>

	<?php if(
		$this->item->params->get('itemTwitterButton',1) ||
		$this->item->params->get('itemFacebookButton',1) ||
		$this->item->params->get('itemGooglePlusOneButton',1)
	): ?>
	<!-- Social sharing -->
	<div class="itemSocialSharing">

		<?php if($this->item->params->get('itemTwitterButton',1)): ?>
		<!-- Twitter Button -->
		<div class="itemTwitterButton">
			<a href="https://twitter.com/share" class="twitter-share-button" data-lang="<?php echo $this->item->langTagForTW; ?>" data-via="<?php if($this->item->params->get('twitterUsername')) echo $this->item->params->get('twitterUsername'); ?>"><?php echo JText::_('K2_TWEET'); ?></a>
			<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemFacebookButton',1)): ?>
		<!-- Facebook Button -->
		<div class="itemFacebookButton">
			<div id="fb-root"></div>
			<script>(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)) return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/<?php echo $this->item->langTagForFB; ?>/sdk.js#xfbml=1&version=v2.5";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));</script>
			<div class="fb-like" data-width="200" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemGooglePlusOneButton',1)): ?>
		<!-- Google +1 Button -->
		<div class="itemGooglePlusOneButton">
			<div class="g-plusone" data-size="medium"></div>
			<script>window.___gcfg={lang:'<?php echo $this->item->langTagForGP; ?>'};(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/platform.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();</script>
		</div>
		<?php endif; ?>

		<div class="clr"></div>

	</div>
	<?php endif; ?>

	<?php if(
		$this->item->params->get('itemCategory') ||
		$this->item->params->get('itemTags') ||
		$this->item->params->get('itemAttachments')
	): ?>
	<div class="itemLinks">

		<?php if($this->item->params->get('itemCategory')): ?>
		<!-- Item category -->
		<div class="itemCategory">
			<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
			<a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemTags') && count($this->item->tags)): ?>
		<!-- Item tags -->
		<div class="itemTagsBlock">
			<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
			<ul class="itemTags">
				<?php foreach ($this->item->tags as $tag): ?>
				<li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
				<?php endforeach; ?>
			</ul>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemAttachments') && count($this->item->attachments)): ?>
		<!-- Item attachments -->
		<div class="itemAttachmentsBlock">
			<span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
			<ul class="itemAttachments">
				<?php foreach ($this->item->attachments as $attachment): ?>
				<li>
					<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
					<?php if($this->item->params->get('itemAttachmentsCounter')): ?>
					<span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
					<?php endif; ?>
				</li>
				<?php endforeach; ?>
			</ul>
		</div>
		<?php endif; ?>

		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
	<!-- Author Block -->
	<div class="itemAuthorBlock">
		<?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
		<img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
		<?php endif; ?>

		<div class="itemAuthorDetails">
			<h3 class="itemAuthorName">
				<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
			</h3>

			<?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
			<p><?php echo $this->item->author->profile->description; ?></p>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
			<span class="itemAuthorUrl"><i class="icon-globe"></i> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url) && $this->item->params->get('itemAuthorEmail')): ?>
			<span class="k2HorizontalSep">|</span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorEmail')): ?>
			<span class="itemAuthorEmail"><i class="icon-envelope"></i> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
			<?php endif; ?>

			<div class="clr"></div>

			<!-- K2 Plugins: K2UserDisplay -->
			<?php echo $this->item->event->K2UserDisplay; ?>

			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
	<!-- Latest items from author -->
	<div class="itemAuthorLatest">
		<h3><?php echo JText::_('K2_LATEST_FROM'); ?> <?php echo $this->item->author->name; ?></h3>
		<ul>
			<?php foreach($this->authorLatestItems as $key=>$item): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
				<a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
			</li>
			<?php endforeach; ?>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php
	/*
	A note regarding 'Related Items'...
	If you add:
	- the CSS rule 'overflow-x:scroll;' in the element div.itemRelated {…} in the k2.css
	- the class 'k2Scroller' to the ul element below
	- the classes 'k2ScrollerElement' and 'k2EqualHeights' to the li element inside the foreach loop below
	- the style attribute 'style="width:<?php echo $item->imageWidth; ?>px;"' to the li element inside the foreach loop below
	...then your Related Items will be transformed into a vertical-scrolling block, inside which, all items have the same height (equal column heights). This can be very useful if you want to show your related articles or products with title/author/category/image etc., which would take a significant amount of space in the classic list-style display.
	*/
	?>

	<?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?>
	<!-- Related items by tag -->
	<div class="itemRelated">
		<h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3>
		<ul>
			<?php foreach($this->relatedItems as $key=>$item): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

				<?php if($this->item->params->get('itemRelatedTitle', 1)): ?>
				<a class="itemRelTitle" href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedCategory')): ?>
				<div class="itemRelCat"><?php echo JText::_("K2_IN"); ?> <a href="<?php echo $item->category->link ?>"><?php echo $item->category->name; ?></a></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedAuthor')): ?>
				<div class="itemRelAuthor"><?php echo JText::_("K2_BY"); ?> <a rel="author" href="<?php echo $item->author->link; ?>"><?php echo $item->author->name; ?></a></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedImageSize')): ?>
				<img style="width:<?php echo $item->imageWidth; ?>px;height:auto;" class="itemRelImg" src="<?php echo $item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>" />
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedIntrotext')): ?>
				<div class="itemRelIntrotext"><?php echo $item->introtext; ?></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedFulltext')): ?>
				<div class="itemRelFulltext"><?php echo $item->fulltext; ?></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedMedia')): ?>
				<?php if($item->videoType=='embedded'): ?>
				<div class="itemRelMediaEmbedded"><?php echo $item->video; ?></div>
				<?php else: ?>
				<div class="itemRelMedia"><?php echo $item->video; ?></div>
				<?php endif; ?>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedImageGallery')): ?>
				<div class="itemRelImageGallery"><?php echo $item->gallery; ?></div>
				<?php endif; ?>
			</li>
			<?php endforeach; ?>
			<li class="clr"></li>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

	<?php if($this->item->params->get('itemVideo') && !empty($this->item->video)): ?>
	<!-- Item video -->
	<a name="itemVideoAnchor" id="itemVideoAnchor"></a>
	<div class="itemVideoBlock">
		<h3><?php echo JText::_('K2_MEDIA'); ?></h3>

		<?php if($this->item->videoType=='embedded'): ?>
		<div class="itemVideoEmbedded">
			<?php echo $this->item->video; ?>
		</div>
		<?php else: ?>
		<span class="itemVideo"><?php echo $this->item->video; ?></span>
		<?php endif; ?>

		<?php if($this->item->params->get('itemVideoCaption') && !empty($this->item->video_caption)): ?>
		<span class="itemVideoCaption"><?php echo $this->item->video_caption; ?></span>
		<?php endif; ?>

		<?php if($this->item->params->get('itemVideoCredits') && !empty($this->item->video_credits)): ?>
		<span class="itemVideoCredits"><?php echo $this->item->video_credits; ?></span>
		<?php endif; ?>

		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
	<!-- Item image gallery -->
	<a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
	<div class="itemImageGallery">
		<h3><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h3>
		<?php echo $this->item->gallery; ?>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemNavigation') && !JRequest::getCmd('print') && (isset($this->item->nextLink) || isset($this->item->previousLink))): ?>
	<!-- Item navigation -->
	<div class="itemNavigation">
		<span class="itemNavigationTitle"><?php echo JText::_('K2_MORE_IN_THIS_CATEGORY'); ?></span>

		<?php if(isset($this->item->previousLink)): ?>
		<a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">&laquo; <?php echo $this->item->previousTitle; ?></a>
		<?php endif; ?>

		<?php if(isset($this->item->nextLink)): ?>
		<a class="itemNext" href="<?php echo $this->item->nextLink; ?>"><?php echo $this->item->nextTitle; ?> &raquo;</a>
		<?php endif; ?>
	</div>
	<?php endif; ?>

	<!-- Plugins: AfterDisplay -->
	<?php echo $this->item->event->AfterDisplay; ?>

	<!-- K2 Plugins: K2AfterDisplay -->
	<?php echo $this->item->event->K2AfterDisplay; ?>

	<?php if(
		$this->item->params->get('itemComments') &&
		(($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1'))
	): ?>
	<!-- K2 Plugins: K2CommentsBlock -->
	<?php echo $this->item->event->K2CommentsBlock; ?>
	<?php endif; ?>

	<?php if(
		$this->item->params->get('itemComments') &&
		($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)
	): ?>
	<!-- Item comments -->
	<a name="itemCommentsAnchor" id="itemCommentsAnchor"></a>
	<div class="itemComments">
		<?php if($this->item->params->get('commentsFormPosition')=='above' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
		<!-- Item comments form -->
		<div class="itemCommentsForm">
			<?php echo $this->loadTemplate('comments_form'); ?>
		</div>
		<?php endif; ?>

		<?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
		<!-- Item user comments -->
		<h3 class="itemCommentsCounter">
			<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
		</h3>

		<ul class="itemCommentsList">
			<?php foreach ($this->item->comments as $key=>$comment): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " authorResponse" : ""; echo($comment->published) ? '':' unpublishedComment'; ?>">
				<span class="commentLink">
					<a href="<?php echo $this->item->link; ?>#comment<?php echo $comment->id; ?>" name="comment<?php echo $comment->id; ?>" id="comment<?php echo $comment->id; ?>">
						<?php echo JText::_('K2_COMMENT_LINK'); ?>
					</a>
				</span>

				<?php if($comment->userImage): ?>
				<img src="<?php echo $comment->userImage; ?>" alt="<?php echo JFilterOutput::cleanText($comment->userName); ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
				<?php endif; ?>

				<span class="commentDate"><?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC2')); ?></span>

				<span class="commentAuthorName">
					<?php echo JText::_('K2_POSTED_BY'); ?>
					<?php if(!empty($comment->userLink)): ?>
					<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow"><?php echo $comment->userName; ?></a>
					<?php else: ?>
					<?php echo $comment->userName; ?>
					<?php endif; ?>
				</span>

				<p><?php echo $comment->commentText; ?></p>

				<?php if(
					$this->inlineCommentsModeration ||
					($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest)))
				): ?>
				<span class="commentToolbar">
					<?php if($this->inlineCommentsModeration): ?>
					<?php if(!$comment->published): ?>
					<a class="commentApproveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=publish&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_APPROVE')?></a>
					<?php endif; ?>

					<a class="commentRemoveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=remove&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_REMOVE')?></a>
					<?php endif; ?>

					<?php if($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest))): ?>
					<a data-k2-modal="iframe" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=report&commentID='.$comment->id)?>"><?php echo JText::_('K2_REPORT')?></a>
					<?php endif; ?>

					<?php if($comment->reportUserLink): ?>
					<a class="k2ReportUserButton" href="<?php echo $comment->reportUserLink; ?>"><?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?></a>
					<?php endif; ?>
				</span>
				<?php endif; ?>

				<div class="clr"></div>
			</li>
			<?php endforeach; ?>
		</ul>

		<!-- Comments Pagination -->
		<div class="itemCommentsPagination">
			<?php echo $this->pagination->getPagesLinks(); ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(
			$this->item->params->get('commentsFormPosition')=='below' &&
			$this->item->params->get('itemComments') &&
			!JRequest::getInt('print') &&
			($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))
		): ?>
		<!-- Item comments form -->
		<div class="itemCommentsForm">
			<?php echo $this->loadTemplate('comments_form'); ?>
		</div>
		<?php endif; ?>

		<?php $user = JFactory::getUser(); if($this->item->params->get('comments') == '2' && $user->guest): ?>
		<div class="itemCommentsLoginFirst"><?php echo JText::_('K2_LOGIN_TO_POST_COMMENTS'); ?></div>
		<?php endif; ?>

	</div>
	<?php endif; ?>

	<?php if(!JRequest::getCmd('print')): ?>
	<div class="itemBackToTop">
		<a class="k2Anchor" href="<?php echo $this->item->link; ?>#startOfPageId<?php echo JRequest::getInt('id'); ?>">
			<?php echo JText::_('K2_BACK_TO_TOP'); ?>
		</a>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

</div>
<!-- End K2 Item Layout -->
  • Timothy Michel
  • Timothy Michel's Avatar
13 Oct 2018 03:16 - 13 Oct 2018 03:21
Timothy Michel replied the topic:After Update to K2 2.9 Extra Fields Don't Work At All

After Update to K2 2.9 Extra Fields Don't Work At All

Category: English K2 Community

Fotis, first of all, thank you so much for that detailed reply. Yes I want to develop adaptive templates. I plan to create a new Joomla template that nearly exclusively uses Flexbox CSS attributes and CSS Grids, and only use Bootstrap 2/3 classes where I have to. Even with CSS Grids, there is still a need for a specific mobile template. So the information you just provided is very very much appreciated.

I set error reporting to maximum as you suggested and then looked at error.log. I found a warning related to the K2/ACYMailing plugin and an error related to the template index.php file.

[Mon Sep 10 21:34:38 2018] [warn] [client 47.42.194.156] mod_fcgid: stderr: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgAcymailingK2users has a deprecated constructor in /[path to plugins]/plugins/acymailing/k2users/k2users.php on line 8


As you can see this was 10 September, 2018 and may have already been corrected in v. 2.9. this may also have been written by ACYMailing.

I also found:

[Fri Oct 12 19:31:50 2018] [warn] [client 174.81.12.11] mod_fcgid: error reading data from FastCGI server

Which means I need to quiz our web host.

and

Fri Oct 12 19:31:50 2018] [error] [client 174.81.12.11] Premature end of script headers: index.php

Which means I have to look at my index.php file.
  • Fotis
  • Fotis's Avatar
08 Oct 2018 01:08 - 08 Oct 2018 01:16
Fotis replied the topic:After Update to K2 2.9 Extra Fields Don't Work At All

After Update to K2 2.9 Extra Fields Don't Work At All

Category: English K2 Community

Switch error reporting to maximum so you can see which part fails (and IF it's K2) as I'm working primarily on PHP 7.2 locally and have no issues at all.

As for sub-templating, JoomlaWorks was literally the first Joomla company to launch such features in its products. That's because we understand CM in CMS. What you want to do is probably called adaptive design/development and it's really not that hard.

In your template's index.php, this is what you need to have different subtemplates per device type:
<?php
// URLs with "?m" or "&m" render mobile pages - much like Google's Blogger does / "?force" or "&force" is used to force the desktop view
if(isset($_GET['m']) && !isset($_GET['force'])){
	include('index.mobile.inc.php');
} else {
	include('index.desktop.inc.php');
}

Then you need a system plugin (using the onAfterInitialise event) to set a PHP constant like define("SITE_VIEW", "mobile"); or define("SITE_VIEW", "desktop");:
		// Desktop or mobile
		if(isset($_GET['m']) && !isset($_GET['force'])){
			define("SITE_VIEW", "mobile");
		} else {
			define("SITE_VIEW", "desktop");
		}

And finally, in your html overrides under /html/com_k2/ you simply check for the value of SITE_VIEW to determine if the user visiting the site is using a mobile or desktop browser.

You would also need the JS redirect in your desktop sub-template, something like:
        <!-- Browser detect and redirect -->
        <script type="text/javascript">
            (function() {
                // Get URL query strings
                function getQS(v) {
                    var qs = window.location.search.substring(1);
                    var qsArray = qs.split("&");
                    for (i = 0; i < qsArray.length; i++) {
                        var qp = qsArray[i].split("=");
                        if (qp[0] == v) {
                            return true;
                        }
                    }
                }

                if (getQS('force')) {
                    document.getElementsByTagName('a').onclick = function(el) {
                        if (el.href.indexOf('?') > 0) {
                            el.href = el.href + '&force=1';
                        } else {
                            el.href = el.href + '?force=1';
                        }
                    }
                }

                if (getQS('m') === undefined) {
                    if (getQS('force')) return;
                    var curUrl = window.location.href;
                    var userAgent = navigator.userAgent || navigator.vendor || window.opera;
                    var getLastChar = curUrl.substr((curUrl.length) - 1);
                    if (((/Android/i).test(userAgent) && (/Mobile/i).test(userAgent)) || (/BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i).test(userAgent)) {
                        if (curUrl.indexOf('?') > 0) {
                            window.location.replace(curUrl + '&m=1');
                        } else {
                            window.location.replace(curUrl + '?m=1');
                        }
                    }
                }
            })();
        </script>

The above makes sure to set ?m or &m and handle ?force or &force if there's a link to enforce the desktop view in your site.

I'm just giving you an idea on how to implement things here, it's not THE solution of course. But the above can work great with any type of caching, either Joomla-based caching or stricter server-side caching e.g. via Varnish or Nginx.

If you need more info, I could make a blog post with more details.
Displaying 1 - 10 out of 10 results.
Powered by Kunena Forum